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

1.0.0 • Public • Published

NPM Version NPM Downloads GitHub issues

Effector kit

🧰


Installation

npm install effector effector-kit

or

yarn add effector effector-kit

Usage

getVoid:

sample({
  source: initMapFx.done,
  fn: getVoid,
  target: createPopupFx,
});

getInverted:

sample({
  source: $loader,
  clock: guard($pending, { filter: getInverted }),
  target: removeLoaderFx,
});

setPayload:

$countries.on(fetchCountriesFx.doneData, setPayload);
$schoolId.on(changeSchoolId, setPayload);

Helpers

export const getVoid = (payload?: unknown): void => undefined;
export const getInverted = (payload: unknown): boolean => !payload;
export const setBoolean = (state: unknown, value: unknown): boolean =>
  Boolean(value);
export const setTrue = (state?: unknown, payload?: unknown): true => true;
export const setFalse = (state?: unknown, payload?: unknown): false => false;
export const setNull = (state?: unknown, payload?: unknown): null => null;
export const setPayload = <Payload = unknown>(
  state: unknown,
  payload: Payload
): Payload => payload;

Readme

Keywords

none

Package Sidebar

Install

npm i effector-kit

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

10.9 kB

Total Files

19

Last publish

Collaborators

  • doasync