Powerful and reliable global state management solution for React
npm install use-interstateuse-interstate is a state management library for React.
> *:warning: The library is now at the beta stage. Any implementations in projects are welcome.
> Please feel free to share your experience with us
> (turtlefly@gmail.com).*
The library does not have dependencies (polyfilled code depends on @babel/runtime* to avoid
duplications).
* It ensures the
performance to be at
least on the same level as the popular state management libraries for React, e. g. Redux,
Recoil.
* It has a small size.
* It is heavily tested (more than 40 tests performed on the source code as well as on bundled code).
* It is written with the use of the standard React hooks only, thus ensuring better compatibility.
It is written in TypeScript* and typed the way the error messages are speaking the human
language (💣💥🙈 You will love it!).
The logic of the use-interstate* library is aligned and synchronized with the natural life cycles
of React components which make the use and feel similar to the standard React hook useState
.
It does not require having a Context Provider* at the root of the component tree of an
application, thus ensuring better security for
applications.
* It is unopinionated and agnostic to application architecture, so one can use the library adopting
either redux-like paradigm with actions, reducers, and selectors, state machine, or use it simply
as an "interstate" variant of the standard useState hook which is great for prototyping and
creating proofs of concepts.
It is compatible with Concurrent mode of React*.
``bash`
npm i use-interstate
* Use
+ initInterstate
+ useInterstate
+ readInterstate
+ acceptSelector method
+ setInterstate
+ resetInterstate`
+ deps
use-interstate and TypeScript*
+ Error messages
+ Dev types
Why not Context Provider*