This repository was archived by the owner on Jan 22, 2025. It is now read-only.
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Q.allSettled #257
Closed
Description
Q.allResolved
is misnamed (due to our new meaning of "resolved" over in promises-aplus/constructor-spec#18) and relies on the clunky synchronous inspection API. I propose Q.allSettled
, which always fulfills with an array of the snapshot objects from #256.
Usage example:
return Q.allSettled([rejectedWith5, fulfilledWith10]).spread(function (one, two) {
assert(one.state === "rejected");
assert(one.reason === 5);
assert(two.state === "fulfilled");
assert(two.value === 10);
});
I am proposing something similar for when.js over in cujojs/when#119 (comment) which is getting somewhat-positive reception.