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.
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
You can use nanostores to define global atoms shared across your application.
Why Bunshi with nanostores?
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
- Decouple your nanostores logic from your UI framework code
- Move your state from component level to global without refactoring components