question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Promise.settle -> can it return an array of the promises instead?

See original GitHub issue

Instead of PromiseInspection results?

I think a really useful method would be Promise.allSettled, similar to Q.allSettled - where you wait for all of the promises to be fulfilled, and return a promise which is fulfilled if all of the promises had been resolved, and rejected if at least one had been rejected.

In other words:

Promise.allSettled([promises]).then(function(){ ... }).catch(function(){...})

Would be equivalent to:

Promise.settle([promises]).all().then(function(){ ... }).catch(function(){...})

if Promise.settle returned an array of promises or if Promise.all could receive an array of PromiseInspection results and work on it.

May I submit a PR to be considered?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
EtaiGcommented, Oct 18, 2014

I thought there was, but testing it out, I see there isn’t. Thanks, I’ll test it further and close the issue if it’s no longer relevant.

I still believe this would be useful as a single utility method though, as Promise.allSettled

0reactions
vitaly-tcommented, Oct 25, 2015

@EtaiG , an advanced version of it: spex.batch

Read more comments on GitHub >

github_iconTop Results From Across the Web

Promise.allSettled() - JavaScript - MDN Web Docs
The Promise.allSettled() method takes an iterable of promises as input and returns a single Promise . This returned promise fulfills when all of...
Read more >
How to Use Promise.allSettled() - Dmitri Pavlutin
The promise returned by Promise.allSettled() always fulfills with an array of statuses, no matter if some (or even all!) input promises are ...
Read more >
Return complete array from Promise - javascript - Stack Overflow
In that case, yes, you need a Promise to be returned from updateTopStories() . See MDN on promises. In the example provided there,...
Read more >
How to Sequentially Resolve an Array of Promises in JavaScript
And the new function is reusable whenever you need to process Promises sequentially. * Thanks to getify for recommending using the await within ......
Read more >
JavaScript Promises: race, all, allSettled, and then
With promise methods like Promise.all() — which takes an array of promises as an argument a returns a promise that resolves when all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found