Nanostores is a tiny state manager for React, React Native, Preact, Vue, Svelte, Solid, Lit, Angular, and vanilla JS. It uses many atomic stores and direct manipulation.
As an atomic state store, it shares a lot in common with jotai and Recoil.
Component state
Bunshi lest you re-use the power of nanostore atoms to build local state for your components, instead of only globally.
The multiplier uses global state
The counter uses component state
The value is derived from both local and global state
Bunshi helps with scoping your atoms. It allows you to pull state up and push state down the component tree.
If the only type of state you have is global state and it doesn’t need to be lazy, then you can avoid bunshi and use nanostores with
global variables.
Start using nanostores for component-level state
Stick to the vanilla javascript API for nanostores
Decouple your nanostores logic from your UI framework code
Move your state from component level to global without refactoring components