1.0.0 • Published 6 years ago
next-chain-if v1.0.0
next-chain-if
a plug in for invoke-next-chain
quickstart
$ npm i next-chain-if
test
$ cd next-chain-if
$ npm install
$ npm run test
example
let d = { a: 0 }
invokeNextChain(d)(
nextChainIf(d => Promise.resolve(d.a % 1 === 0), async (d, next) => { ++d.a; await next() }),
d => ++d.a
)
.then(console.log(d)) // output { a: 2 }
1.0.0
6 years ago