promise-all

1.0.0 • Public • Published

promise-all

Build status NPM version js-xo-style

A Promise.all but for Objects as well as Arrays

Installation

Install promise-all using npm:

npm install --save promise-all

Usage

Module usage

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]
  });

API

all(val)

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.

Related

License

MIT © Joakim Carlstein

Package Sidebar

Install

npm i promise-all

Weekly Downloads

1,024

Version

1.0.0

License

MIT

Last publish

Collaborators

  • joakimbeng