Framework-agnostic state management library designed for simplicity and scalability
Simple primitives
xoid is based on atoms. Atoms are holders of state. create
function is used to create them.
It has a Recoil-inspired API for derived atoms.
Actions
With the second argument, you can specify actions for your atoms.
React integration
xoid has a minimal React integration.
No need for wrapping components into context providers.
Just import useAtom
and start using!
No more hand-written reducers!
There's the .focus
method, which can be used as a selector/lens.
xoid is based on immutable updates, so if you "surgically" set state of a focused branch, changes will propagate to the root.
No-API Finite State Machines!
No additional syntax is required to define and use finite state machines. Just use the second argument of the callback as the state transition function.
- Easy to learn
- Small bundle size
- Zero configuration
- Framework-agnostic
- Computed values
- Async actions
- Transient updates
- Local & global state
- Finite state machines
- Extensive Typescript support
- Devtools