chain-of-promise

1.0.1 • Public • Published

chain-of-promise

Implementation of chain of responsibility pattern design with Promise ES6

Install

npm install chain-of-promise

Usage

const Chain = require('chain-of-promise')
 
var chain = new Chain({hello: 'dude'})
 
chain.add((resolve, reject, context) => {
  // do Something with context and/or create a return value
})
chain.add((resolve, reject, context, data) => {
  // do Something with context and/or the data value
})
chain.start().then((data) => {
  // Lets finish with an ending function
})

/chain-of-promise/

    Package Sidebar

    Install

    npm i chain-of-promise

    Weekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • matthd
    • rmeja