Chapter 4. Asynchronous Programming

ES6 introduced a native support for the well-known programming patterns. One such pattern is the Promise pattern, which makes it easier to read and write the asynchronous code. In this chapter, we will learn to write asynchronous code using the ES6 Promise API. The new JavaScript and HTML5 asynchronous APIs are now being implemented with Promises to facilitate writing less and cleaner code. Therefore, it's important to learn Promises in-depth. We will also see some example APIs that are exposed using Promises such as the Web Cryptography API, and the Battery Status API.

In this chapter, we'll cover:

  • The JavaScript execution model
  • The difficulties faced while writing the asynchronous code
  • Creating Promises and how ...

Get React: Building Modern Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.