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
-
effector-async-local-storage - Effector Domain based on AsyncLocalStorage
-
ts-fp-di - Tiny TypeScript functional dependency injection, based on Node.js AsyncLocalStorage