Promise.any is an inverse of Promise.all, right? There and back again:

Promise.all(promises.map(p => p.then(r => Promise.reject(r), e => e)))
  .then(r => Promise.reject(r), e => e)

https://jsfiddle.net/jib1/f085bcyk/

That said, Promise.any has a nice ring to it.

.: Jan-Ivar :.

On 10/30/19 6:39 PM, Jason Orendorff wrote:
Rather; but there is still a (rapidly closing) window to comment on the
*next* proposal in this vein: Promise.all <
https://github.com/tc39/proposal-promise-any/#ecmascript-proposal-promiseany>.
It is a stage 3 proposal now. Our representative on the ECMAScript standard
committee is Yulia Startsev (or you can just email me).

-j


_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to