What problem does it solve?
TanStack Store removes complexity and unpredictable updates from UI state by providing a lightweight, immutable, reactive data store that works across frameworks so developers can build predictable, efficient stateful user interfaces.
Core Features & Use Cases
- Reactive Stores: Create immutable Store instances with subscribe and setState APIs for predictable updates in single-page applications.
- Computed & Effects: Use Derived for computed values and Effect for side effects with explicit mount/unmount lifecycles to manage subscriptions and cleanup.
- Framework Integration: Use adapters for React, Vue, Solid, Angular, and Svelte to connect stores to component rendering with selectors and shallow equality to minimize re-renders.
- Use Case: Implement module-level stores for counters, filtered/sorted/paginated lists, and cross-component shared state with batched updates to avoid redundant renders.
Quick Start
Create a Store for your state, derive a computed value with Derived, mount the Derived or Effect within your component lifecycle, and read or update state through setState to observe reactive updates.