Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nanostores/react

React integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores
https://github.com/nanostores/react

Last synced: 5 days ago
JSON representation

React integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores

Awesome Lists containing this project

README

        

# Nano Stores React

React integration for **[Nano Stores]**, a tiny state manager
with many atomic tree-shakable stores.

- **Small.** Less than 1 KB. Zero dependencies.
- **Fast.** With small atomic and derived stores, you do not need to call
the selector function for all components on every store change.
- **Tree Shakable.** The chunk contains only stores used by components
in the chunk.
- Was designed to move logic from components to stores.
- It has good **TypeScript** support.

```tsx
import { useStore } from '@nanostores/react'

import { profile } from '../stores/profile.js'

export const Header = () => {
const { userId } = useStore(profile)
return {currentUser.name}
}
```

[Nano Stores]: https://github.com/nanostores/nanostores/

---

Made at Evil Martians, product consulting for developer tools.

---