promise-any

returns first successful promise. As in Promise.any() which is not part of the ES6 spec

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
promise-any
4100.2.07 years ago8 years agoMinified + gzip package size for promise-any in KB

Readme

promise-any
Codeship Status for m0ppers/promise-any
ES6 promises don't provide any(). A small library to implement them. Will convert arguments to promises if not already a promise.
var promiseAny = require('promise-any');

promiseAny([
    Promise.reject('✗'),
    Promise.resolve('✓'),
]).then(function(value) {
    // value is '✓' :)
});

promiseAny([
    Promise.reject('✗'),
    Promise.reject('✗'),
]).catch(function(reasons) {
    // reasons is ['✗', '✗'] :(
});