A Promise.all but for Objects as well as Arrays
Install promise-all using npm:
npm install --save promise-allvar all = require('promise-all');
all({key1: Promise.resolve(false)})
.then(function (val) {
// val === {key1: false}
});
all([Promise.resolve(false)])
.then(function (val) {
// val === [false]
});| Name | Type | Description |
|---|---|---|
val |
`Array | Object` |
Returns: Promise, which resolves when all promises in the passed Object or Array are resolved.
MIT © Joakim Carlstein