O'Reilly logo

JavaScript Promises Essentials by Rami Sarieddine

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 3. Chaining of Promises

One of the most important features of promises is the ability to chain and manage sequences of asynchronous operations. In the previous chapter, we learned the details of the Promise API and how it works; notably, we saw how the then method works. We also learned about the current browser compatibility for promises and the libraries that have implemented and extended JavaScript promises. In this chapter, we will cover the following topics:

  • How chaining came to be in an asynchronous JavaScript
  • Implementing chaining with promises
  • Transforming from callback hell into well-organized promise chains

Chaining like never before

As we learned in the previous two chapters, promises tend to bring the prowess of synchronous programming ...

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