A Promise.all but for Objects as well as Arrays
npm install promise-all[![Build status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![js-xo-style][codestyle-image]][codestyle-url]
> A Promise.all but for Objects as well as Arrays
Install promise-all using npm:
``bash`
npm install --save promise-all
`javascript
var 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| An Object or Array of promises to resolve |
Returns: Promise, which resolves when all promises in the passed Object or Array are resolved.
* promise-or
* promise-and
* promise-not
* promise-if`
MIT © Joakim Carlstein
[npm-url]: https://npmjs.org/package/promise-all
[npm-image]: https://badge.fury.io/js/promise-all.svg
[travis-url]: https://travis-ci.org/joakimbeng/promise-all
[travis-image]: https://travis-ci.org/joakimbeng/promise-all.svg?branch=master
[codestyle-url]: https://github.com/sindresorhus/xo
[codestyle-image]: https://img.shields.io/badge/code%20style-xo-brightgreen.svg?style=flat