All Projects → rpgeeganage → alls

rpgeeganage / alls

Licence: MIT license
Just another library with the sole purpose of waiting till all promises to complete. Nothing more, Nothing less.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to alls

tall
Promise-based, No-dependency URL unshortner (expander) module for Node.js
Stars: ✭ 56 (+330.77%)
Mutual labels:  promises, promise, typescript-library
Promise Fun
Promise packages, patterns, chat, and tutorials
Stars: ✭ 3,779 (+28969.23%)
Mutual labels:  promises, promise, promise-library
Bluebird Api
Bluebird compatible API on top of native promises.
Stars: ✭ 36 (+176.92%)
Mutual labels:  promises, promise
Breeze
Javascript async flow control manager
Stars: ✭ 38 (+192.31%)
Mutual labels:  promises, promise
Tascalate Concurrent
Implementation of blocking (IO-Bound) cancellable java.util.concurrent.CompletionStage and related extensions to java.util.concurrent.ExecutorService-s
Stars: ✭ 144 (+1007.69%)
Mutual labels:  promises, promise
Asyncro
⛵️ Beautiful Array utilities for ESnext async/await ~
Stars: ✭ 487 (+3646.15%)
Mutual labels:  promises, promise
P Map
Map over promises concurrently
Stars: ✭ 639 (+4815.38%)
Mutual labels:  promises, promise
Functional Promises
Write code like a story w/ a powerful Fluent (function chaining) API
Stars: ✭ 141 (+984.62%)
Mutual labels:  promises, promise
Hydra
⚡️ Lightweight full-featured Promises, Async & Await Library in Swift
Stars: ✭ 1,954 (+14930.77%)
Mutual labels:  promises, promise-library
promiviz
Visualize JavaScript Promises on the browser. Visualize the JavaScript Promise APIs and learn. It is a playground to learn about promises faster, ever!
Stars: ✭ 79 (+507.69%)
Mutual labels:  promises, promise
Q
A platform-independent promise library for C++, implementing asynchronous continuations.
Stars: ✭ 179 (+1276.92%)
Mutual labels:  promises, promise
promised-hooks
Middleware utility for your Promises
Stars: ✭ 25 (+92.31%)
Mutual labels:  promise, promise-library
Yaku
A lightweight promise library
Stars: ✭ 276 (+2023.08%)
Mutual labels:  promises, promise
Promise.hpp
C++ asynchronous promises like a Promises/A+
Stars: ✭ 31 (+138.46%)
Mutual labels:  promises, promise
Pg Promise
PostgreSQL interface for Node.js
Stars: ✭ 3,059 (+23430.77%)
Mutual labels:  promises, promise-library
Vine
Python promises
Stars: ✭ 83 (+538.46%)
Mutual labels:  promises, promise
doasync
Promisify functions and objects immutably
Stars: ✭ 27 (+107.69%)
Mutual labels:  promises, promise
spex
💡 Specialized Promise Extensions
Stars: ✭ 51 (+292.31%)
Mutual labels:  promises, promise-library
Promise
Promise / Future library for Go
Stars: ✭ 149 (+1046.15%)
Mutual labels:  promises, promise
market-pricing
Wrapper for the unofficial Steam Market Pricing API
Stars: ✭ 21 (+61.54%)
Mutual labels:  promises, promise

alls (All Settled) - wait till all the promises settled

License Version Language grade: JavaScript Codacy Badge Codacy Badge Build Status Known Vulnerabilities Maintainability

Just another library with the sole purpose of waiting till all promises to complete. Nothing more, Nothing less.

(Since, The Promise.all() method returns a single Promise that resolves when all of the promises passed as an iterable have resolved or when the iterable contains no promises. It rejects with the reason of the first promise that rejects.)

TypeScript Doc: https://rpgeeganage.github.io/alls/doc/

Basic Usage:

const { alls } = require('alls');

const results = await alls([promise1, promise2, .....promiseN]);
// structure of results
[
  {
    status: 'fulfilled',
    value: promise1-value
  },
  {
    status: 'rejected',
    reason: error-from-promise2
  }
...
  {
    status: 'fulfilled',
    value: promiseN-value
  }
]

Return value for Resolve

{
    status: 'fulfilled',
    value: <promise return value>
}

Return value for Reject

{
    status: 'rejected',
    reason: <Error thrown by promise>
}

final output

const error1 = new Error('error 1');
const error2 = new Error('error 2');
const error3 = new Error('error 3');

const results = await alls([
  Promise.resolve(1),
  Promise.reject(error1),
  Promise.resolve(2),
  Promise.reject(error2),
  Promise.resolve(3),
  Promise.reject(error3)
]);

/**
* content of the 'result'
*/
[
  { state: 'fulfilled', value: 1 },
  { state: 'rejected', reason: error1 },
  { state: 'fulfilled', value: 2 },
  { state: 'rejected', reason: error2 },
  { state: 'fulfilled', value: 3 },
  { state: 'rejected', reason: error3 }
]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].