chainesis
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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

Package Sidebar

Install

npm i chainesis

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

54.6 kB

Total Files

43

Last publish

Collaborators

  • michiel87