Skip to content

settle([...]) returns a Promise that is fulfilled when all items in the array are either fulfilled or rejected.

License

Notifications You must be signed in to change notification settings

pgaubatz/node-promise-settle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

promise-settle

npm version Build Status Coverage Status Dependency Status

settle([...]) returns a Promise that is fulfilled when all items in the array are either fulfilled or rejected.

Installation

npm install --save promise-settle

Usage

var settle = require('promise-settle');

settle([true, Promise.resolve(3), Promise.reject(new Error('error'))])
  .then(function (results) {
    results.forEach(function (result) {
      if (result.isFulfilled()) {
        console.log('Promise is fulfilled', result.value());
      } else {
        console.log('Promise is rejected', result.reason());
      }
    })
  });

About

settle([...]) returns a Promise that is fulfilled when all items in the array are either fulfilled or rejected.

Resources

License

Stars

Watchers

Forks

Packages

No packages published