await keywords; and it even includes RxJS Observables, a widely-used external library for handling asynchronous tasks.
Each of the posts includes complete source code for a runnable Node.js project demonstrating the technique covered in the post, and the posts are unified by a common case study so you can compare different approaches to the same task. The code for each post is also available on GitHub under an MIT license so you can download it and use it in your own projects.
Here’s a summary of the posts in the series along with a link to each post.
This post builds on the information in the Introduction post by delving deeper into how Promises represent the state of an asynchronous action and how values returned by Promises can be manipulated. Individual Promises provide powerful functionality, and you can also use collections of Promises to perform actions based on the state of Promises in the collection. Promises can also be chained together to perform a series of actions that manipulate their values and change the path of program execution. You can see all these techniques in action and experiment with them using the code in this post.
This post explains RxJS Observables and how to use them with the observer and iterator patterns of functional programming. You’ll also learn about how Observables compare to Promises and how to handle errors in Observables.
Sometimes it doesn’t matter when your asynchronous tasks return values as long as they eventually do. (Or do not. There is no try. That’s handled by
But in a lot of cases a program needs to wait for the completion or failure of an asynchronous task before proceeding, either because it needs to know that the task was successful or not, or because it needs the data from the task to continue processing. This post explains the
await keywords and demonstrates how to use them with a practical example. You’ll also learn about the potential performance pitfalls of injudicious use of
With all these asynchronous tools available to you, sometimes it can be tough choosing the most appropriate one for a specific task. Sometimes the best choice is to combine more than one, like using RxJS Observables with async and await. (How to do that is explained in the previous post.)
This post provides you with a decision tree for choosing the best asynchronous tool(s) for specific programming tasks. It’s presented as both flowchart and tabular form for different styles of learning. The post also includes some practical tips to help you use asynchronous techniques more effectively.
Twilio account – If you sign up for a free Twilio account using this link you’ll receive an additional $10 credit when you upgrade. It will come in handy when you do some of these tutorials.
If you’re looking for reference documentation on the topics covered in the posts mentioned here, check out the following canonical sources: