DEV Community

loading...

Discussion on: Awaiting multiple requests to finish using Promise.all

Collapse
oligospermia profile image
Mesalazine

I understand this is clearly a blog promotion ad post, but still would make more sense to list neighboring methods that can achieve different goals in one's project:

  • .allSettled() - returns a promise that resolves after all of the given promises have either resolved or rejected, with an array of objects that each describes the outcome of each promise.
  • .any() - takes an iterable of Promise objects and, as soon as one of the promises in the iterable fulfills, returns a single promise that resolves with the value from that promise. (experimental method)
  • .race() - method returns a promise that fulfills or rejects as soon as one of the promises in an iterable fulfills or rejects, with the value or reason from that promise.