O'Reilly logo

Node.js Design Patterns - Second Edition by Luciano Mammino, Mario Casciaro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Asynchronous Control Flow Patterns with ES2015 and Beyond

In the previous chapter, we learned how to deal with asynchronous code using callbacks and how they can have a bad impact on our code, generating issues such as callback hell. Callbacks are the building blocks of asynchronous programming in JavaScript and in Node.js, but over the years, other alternatives have emerged. Those alternatives are more sophisticated in order to be able to deal with asynchronous code in ways that are more convenient.

In this chapter, we are going to explore some of the most famous alternatives, promises and generators. We will also explore async await, an innovative syntax that will be available in JavaScript as part of the release of ECMAScript 2017. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required