Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Evolução do JavaScript Assíncrono

A Evolução do JavaScript Assíncrono

Ruan Martinelli

December 02, 2017
Tweet

More Decks by Ruan Martinelli

Other Decks in Technology

Transcript

  1. A EVOLUÇÃO DO.
    JAVASCRIPT ASSÍNCRONO.
    RUAN MARTINELLI .
    ruanmartinelli.com .
    @ruanmartinelli .

    View full-size slide

  2. “ANY APPLICATION THAT CAN BE WRITTEN
    IN JAVASCRIPT, WILL EVENTUALLY BE
    WRITTEN IN JAVASCRIPT.”
    -JEFF ATWOOD, STACK OVERFLOW

    View full-size slide

  3. # OF PULL REQUESTS
    octoverse.github.com

    View full-size slide

  4. 1
    2
    3
    4
    1
    2
    3
    4 ✔
    1
    2
    3 ✔
    1
    2
    3

    View full-size slide

  5. 1
    2
    3
    4
    1
    1
    2
    2
    3 ✔
    3
    4 ✔
    1
    2
    3

    View full-size slide

  6. });
    });
    });
    });
    });
    });
    });
    });
    CALLBACK.

    View full-size slide

  7. getLivro()
    .then()
    .catch()

    View full-size slide

  8. ASYNC FUNCTIONS
    (async/await).

    View full-size slide

  9. ASYNC FUNCTIONS.

    View full-size slide

  10. ASYNC FUNCTIONS.

    View full-size slide

  11. ASYNC FUNCTIONS.

    View full-size slide

  12. ASYNC FUNCTIONS.

    View full-size slide

  13. - Sempre retornam uma Promise;
    ASYNC FUNCTIONS.

    View full-size slide

  14. ASYNC FUNCTIONS.
    - Sempre retornam uma Promise;

    View full-size slide

  15. ASYNC FUNCTIONS.
    - Sempre retornam uma Promise;
    - Permitem o uso do await;

    View full-size slide

  16. - Sempre retornam uma Promise;
    - Permitem o uso do await;
    ASYNC FUNCTIONS.

    View full-size slide

  17. - Sempre retornam uma Promise;
    - Permitem o uso do await;
    - Uso de constructs nativos;
    ASYNC FUNCTIONS.

    View full-size slide

  18. - Sempre retornam uma Promise;
    - Permitem o uso do await;
    - Uso de constructs nativos;
    ASYNC FUNCTIONS.

    View full-size slide

  19. - Sempre retornam uma Promise;
    - Permitem o uso do await;
    - Uso de constructs nativos;
    - Tratamento de erros com try/catch.
    ASYNC FUNCTIONS.

    View full-size slide

  20. - Observables, RxJS;
    - Generators;
    - Promise.prototype.finally;
    - Bluebird;
    - Promise Constructor;
    - Loops em Async Functions.
    INDO ALÉM....

    View full-size slide