Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smelukov/promisesettled
Simple settled promise
https://github.com/smelukov/promisesettled
Last synced: about 1 month ago
JSON representation
Simple settled promise
- Host: GitHub
- URL: https://github.com/smelukov/promisesettled
- Owner: smelukov
- License: mit
- Created: 2016-01-25T14:43:12.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-11T19:52:15.000Z (over 7 years ago)
- Last Synced: 2024-10-10T02:41:03.890Z (about 1 month ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/smelukov/PromiseSettled.svg?branch=master)](https://travis-ci.org/smelukov/PromiseSettled)
# PromiseSettled
Simple settled promise.### How to use it?
```javascript
var allSettled = require('promise-ext-settled');allSettled(arrayOfPromises, onProgress)
.then(function(promisesStatus) {
console.log(promisesStatus)
});
```### What is that?
This is a realization of a small and simple allSettled promise, that supports CommonJS, AMD ang non-module definition.allSettled promise - is the promise that will be resolved only when all of the passed promises will be settled (fulfilled or rejected).
allSettled promise will be resolved with an array of objects that contains an info (status and value) about all of the passed promise.
As well, onProgress function will be called (if passed) after any of the passed promises will be settled (resolved or rejected).
onProgress function may accept two arguments:
* object that contains an info about settled promise: status (true or false) and value (fulfilled or rejected value).
* object that contains overall execution status with following properties: total (total tasks to be executed), resolved (succeeded by now), rejected (failed by now)### How to install it?
```shell
npm install promise-ext-settled --save
```
or
```shell
bower install promise-ext-settled --save
```### How to build it?
```shell
gulp
```