Thanks to visit codestin.com
Credit goes to github.com

Skip to content

joakimbeng/promise-all

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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`

Returns: Promise, which resolves when all promises in the passed Object or Array are resolved.

Related

License

MIT © Joakim Carlstein

About

A Promise.all but for Objects as well as Arrays

Resources

Stars

Watchers

Forks

Packages

No packages published