chain-of-promise
v1.0.1
Published
Implementation of chain of responsibility pattern design with Promise ES6
Downloads
3
Readme
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
})