resolveall

1.0.2 • Public • Published

resolveall

Resolves all promises, breaking chain if needed.

npm install resolveall
```js
 
## Example 
 
Executes promise like functions using a chain. If one of the promises is broken, execution is terminated.
 
 
```js
var a = function(resolve, reject) {
    console.log("Executing a")
    return resolve("a")
};
var b = function(resolve, reject) {
    console.log("Executing b")
    return reject("error")
};
 
var c = function(resolve, reject) {
    console.log("Executing c ", this)
    return resolve("c")
};
 
resolveall.chain([a, b, c], this).then(function(res) {
    console.log(res);
}).catch(function(e) {
    console.log("Error", e);
})

Readme

Keywords

none

Package Sidebar

Install

npm i resolveall

Weekly Downloads

0

Version

1.0.2

License

ISC

Last publish

Collaborators

  • nchanged