@anic/chain
v0.0.103
Published
chain
Downloads
13
Readme
@anic/chain
Chain for JavaScript
Install
$ yarn add @anic/chain
Usage
import chain from '@anic/chain';
// create
const { add, run } = chain();
// add action
add((data, next) => next());
// tap action
run({ value: 1 });
Api
chain(): { add: Function, run: Function }
create onion Object, which contain add
and run
function;
add(action: Function): () => void
add action, return remove
handler;
run(...args: any[]): any
run action by name
and args
;