1.0.7 • Published 1 year ago

@tory.ir/react-atomic v1.0.7

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
1 year ago

@tory.ir/react-atomic

An atomic state manager just like recoil.

In under 100 lines of code, plain and simple.

Without the need to have a context provider in component tree.

With selector functions rerendering only if the selected value is changed.

npm i @tory.ir/react-atomic

demo

sandbox demo

export const stateAtom = new Atom({ a: 1, b: 1 });

// inside component
    const setState = useAtomSetState(stateAtom);
// or
    const state = useAtomValue(stateAtom);
// or
    const selectedState = useAtomSelectValue(stateAtom,(x) => x.a);
// or
    const [state,setState] = useAtomState(stateAtom);

made with ❤️

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago