liveBook · Manning

Promise.all

Promise.all is a JavaScript static method that returns a promise fulfilled with an array of results when all input promises fulfill, or rejected if any input promise rejects.

How 2 Manning books explain it

Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond

A Promise class method that returns a promise fulfilled when all input promises fulfill, or rejected when any input promise rejects.

How it is used
Combines multiple asynchronous requests when a result depends on all of them.
How deep it goes
Defines the aggregate promise and demonstrates joining requests, without detailing implementation internals.
Examples
Uses author-and-article requests and a credit-check task combining Promise.all with Promise.race.
What you can do after
Apply Promise.all to wait for multiple requests before using their combined results.

Read how Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond explains Promise.all →

Secrets of the JavaScript Ninja, Second Edition

A JavaScript Promise combinator that returns a promise fulfilled when all input promises fulfill, or rejected if any input promise rejects.

How it is used
Coordinates independent asynchronous tasks in parallel and gathers their results before continuing.
How deep it goes
Specifies array input, fulfillment when all promises succeed, ordered results, and rejection if any promise fails.
Examples
Uses parallel JSON requests for ninja, map, and plan data, then checks the gathered results.
What you can do after
Apply it via Promise.all to wait for multiple asynchronous results and handle their shared success or failure.

Read how Secrets of the JavaScript Ninja, Second Edition explains Promise.all →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.