Legend-State is a super fast and powerful state library that enables fine-grained reactivity and easy automatic persistence
Legend-State is a super fast and powerful state library that enables fine-grained reactivity and easy automatic persistence
See [Fast ](https://www.legendapp.com/open-source/state/v3/intro/fast/) for more details of why Legend-State is so fast. ### 3. Fine-grained reactivity for minimal renders Legend-State lets you make your renders super fine-grained, so your apps will be much faster because React has to do less work. The best way to be fast is to render less, less often. ```jsx function FineGrained() { const count$ = useObservable(0) useInterval(() => { count$.set(v => v + 1) }, 600) // The text updates itself so the component doesn't re-render return ( ) } ``` ### 4. Powerful sync and persistence Legend-State includes a powerful [sync and persistence system](https://www.legendapp.com/open-source/state/v3/usage/persist-sync/) . It easily enables local-first apps by optimistically applying all changes locally first, retrying changes even after restart until they eventually sync, and syncing minimal diffs. We use Legend-State as the sync systems in [Legend](https://legendapp.com) and [Bravely](https://bravely.io), so it is by necessity very full featured while being simple to set up. Local persistence plugins for the browser and React Native are included, with sync plugins for [Keel](https://www.keel.so), [Supabase](https://www.supabase.com), [TanStack Query](https://tanstack.com/query), and `fetch`. ``` … ``` ## Install `bun add @legendapp/state` or `npm install @legendapp/state` or `yarn add @legendapp/state` ## Highlights - ✨ Super easy to use - ✨ Super fast ⚡️ - ✨ Super small at 4kb - ✨ Fine-grained reactivity - ✨ No boilerplate - ✨ Designed for maximum performance and scalability - ✨ React components re-render only on changes - ✨ Very strongly typed with TypeScript - ✨ Persistence plugins for automatically saving/loading from storage - ✨ State can be global or within components [Read more](https://www.legendapp.com/open-source/state/v3/intro/why/) about why Legend-State might be right for you. ## Documentation See [the documentation site](https://www.legendapp.com/open-source/state/). ## Community Join us on [Discord](https://discord.gg/5CBaNtADNX) to get involved with the Legend community. ## ⚖️ License [MIT](LICENSE) --- Legend-State is created and maintained by [Jay Meistrich](https://github.com/jmeistrich) with [Legend](https://www.legendapp.com) and [Bravely](https://www.bravely.io).
No open issues yet, or sync has not completed.