All Projects → dotSlashLu → promise-waterfall

dotSlashLu / promise-waterfall

Licence: other
promise-waterfall extends promise utilities with sequential flow control function like async.waterfall

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to promise-waterfall

Wx Promise Request
解决微信小程序 wx.request 请求的并发数限制、不支持异步问题
Stars: ✭ 226 (+707.14%)
Mutual labels:  promise
Task Easy
A simple, customizable, and lightweight priority queue for promises.
Stars: ✭ 244 (+771.43%)
Mutual labels:  promise
promise-all-properties
A helper function that recevies an object with a promise in each property and returns a promise that resolves to an object with the same properties and the resolved values of the promises
Stars: ✭ 26 (-7.14%)
Mutual labels:  promise
Radwimps
君の then-then-then 世は Promise で Future
Stars: ✭ 229 (+717.86%)
Mutual labels:  promise
Await Of
await wrapper for easier errors handling without try-catch
Stars: ✭ 240 (+757.14%)
Mutual labels:  promise
When
⏰ A lightweight implementation of Promises in Swift
Stars: ✭ 250 (+792.86%)
Mutual labels:  promise
React Organism
Dead simple React state management to bring pure components alive
Stars: ✭ 219 (+682.14%)
Mutual labels:  promise
bluff
🙏 Promise A+ implementation
Stars: ✭ 14 (-50%)
Mutual labels:  promise
Spirit
Modern modular library for building web applications
Stars: ✭ 241 (+760.71%)
Mutual labels:  promise
promise4j
Fluent promise framework for Java
Stars: ✭ 20 (-28.57%)
Mutual labels:  promise
Massive Js
A data mapper for Node.js and PostgreSQL.
Stars: ✭ 2,521 (+8903.57%)
Mutual labels:  promise
Popsicle
Simple HTTP requests for node and the browser
Stars: ✭ 238 (+750%)
Mutual labels:  promise
Axios
Promise based HTTP client for the browser and node.js
Stars: ✭ 89,857 (+320817.86%)
Mutual labels:  promise
Core Js
Standard Library
Stars: ✭ 15,854 (+56521.43%)
Mutual labels:  promise
promised-hooks
Middleware utility for your Promises
Stars: ✭ 25 (-10.71%)
Mutual labels:  promise
Luch Request
luch-request 是一个基于Promise 开发的uni-app跨平台、项目级别的请求库,它有更小的体积,易用的api,方便简单的自定义能力。
Stars: ✭ 219 (+682.14%)
Mutual labels:  promise
Escape From Callback Mountain
Example Project & Guide for mastering Promises in Node/JavaScript. Feat. proposed 'Functional River' pattern
Stars: ✭ 249 (+789.29%)
Mutual labels:  promise
parley
Flow control harness for implementors. Builds a Deferred object that supports async/await, promise chaining, and conventional Node callbacks.
Stars: ✭ 23 (-17.86%)
Mutual labels:  promise
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 (+182.14%)
Mutual labels:  promise
fetchye
✨ If you know how to use Fetch, you know how to use Fetchye [fetch-yae]. Simple React Hooks, Centralized Cache, Infinitely Extensible.
Stars: ✭ 36 (+28.57%)
Mutual labels:  promise

Promise-waterfall

Promise-waterfall extends promise utilities with sequential flow control like async.waterfall.

Since Promise.all(promiseArr) || Promise.spread(promiseArr) execs promises simultaneously, each of the functions in the promiseArr cannot depend on another, and if you want promises execute in order or some of the promises need the resolved value of another, this library is for you.

Installation

npm install promise-waterfall

Usage

var waterfall = require("promise-waterfall");
var func1 = function(){
        // return a promise
    },
    func2 = function(res1){
        // optionally use res1 
        // which is resolved from func1 
        // and return a promise
    },
    func3 = function(res2){
        // like func2
    },
    promiseSequence = [func1, func2, func3];
    
waterfall(promiseSequence) 
    // the promiseSequence will executes sequentially
    // just like func1().then(func2).then(func3)
    .then(function(res){
        // use res
    })
    .catch(function(err){
        // deal with error
    });

See test cases in /tests for full examples.

Development

Test

run npm test or make test

Changelog

  • v0.1 (Thanks to @stevenvachon)
    • Return a promise(fulfilled when returned normally or rejected when error occurs) in whatever condition;
    • Compatible with all libraries conforming to Promises/A+ spec;
    • Dropped client support
  • v0.0.1
    • First release

Thanks

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].