0.0.103 • Published 3 years ago

@anic/chain v0.0.103

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

@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;

0.0.103

3 years ago

0.0.102

3 years ago

0.0.101

3 years ago