0.0.3 • Published 5 years ago

chainesis v0.0.3

Weekly downloads
381
License
MIT
Repository
github
Last release
5 years ago

chainesis

Chain functions to other functions.

Installation

npm

npm install --save chainesis

yarn

yarn add chainesis

API

chain

import { chain } from 'chainesis'

const [hookOnChain, runChain] = chain((runChainArg, next) => {
 // do something
 // pass something to next function
 next(something)
})

// chained to chain
hookOnChain((something, next) => {
 // Do new stuff with something from root function
 next(new stuff)
})

// chained to chain
const [hookOnSecond, hookOff] = hookOnChain((something, next) => {
 // Do new stuff with something from root function
 next(new stuff)
})

// chained to hookOnChain
const [goOnForeverHook, hookOffBranchToo] = hookOnSecond((argsFromHookOnChain, next) => {
 // here we go again!
  next(indefinitely)   
})

License

MIT

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago