Introduction to Asynchronous JavaScript

preview_player
Показать описание
0:00:00 Introduction
5:38 Concurrent Tasks in JavaScript -- Single-threaded / Callbacks and callback hell
9:22 JavaScript Promises, the promise constructor and the executor function
21:38 Promise results and Immediately settled promises
42:08 Promise chaining
1:31:10 Promise rejection handling -- All and any
1:41:50 The idea of Async functions
2:18:06 Deciding between promises and async/await -- Reasoning.
2:39:13 Iterators and Generators -- Async generators
2:43:54 Conclusion

JS has different ways to leverage this asynchronism through its various ECMAScript (ES) editions.

It began with callback functions that let you define asynchronous behavior through functions passed to other functions as parameters.

This was then made easier by introducing Promises, also known as the Futures API. Promises are objects that asynchronously function to return a value sometime in the future.

Following this, with ES 2017, the Javascript community sprinkled some syntactic sugar and sparkle over the Promises API to introduce the async/await syntax.

However with all this tools, the aim has always been to make the process of writing asynchronous code easier, simpler, and more intuitive.
Рекомендации по теме