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

0.3.0 • Public • Published

effector-storify

Effector utils for storify Effect/Event

API

fx$last

const fx = fx$last(createEffect<number, number>(x => x));
fx(0);
fx(1);
fx.$last.getState(); // 1

ev$last

const ev = ev$last(createEvent<number>());
ev(0);
ev(1);
ev.$last.getState(); // 1

fx$all

const fx = fx$all(createEffect<number, number>(x => x));
fx(0);
fx(1);
fx.$all.getState(); // [0, 1]

ev$all

const ev = ev$all(createEvent<number>());
ev(0);
ev(1);
ev.$all.getState(); // [0, 1]

fx$flatAll

const fx = fx$flatAll(createEffect<number, number[]>((x) => [x]));
fx(0);
fx(1);
fx.$flatAll.getState(); // [0, 1]

ev$flatAll

const ev = ev$flatAll(createEvent<number[]>());
ev([0]);
ev([1]);
ev.$flatAll.getState(); // [0, 1]

Related

Package Sidebar

Install

npm i effector-storify

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

6.36 kB

Total Files

5

Last publish

Collaborators

  • darrrk