Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dkzlv/nanostores-react
https://github.com/dkzlv/nanostores-react
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dkzlv/nanostores-react
- Owner: dkzlv
- License: mit
- Created: 2023-08-26T13:26:59.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-26T14:26:20.000Z (about 1 year ago)
- Last Synced: 2023-08-26T15:29:40.774Z (about 1 year ago)
- Language: TypeScript
- Size: 377 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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/