Immutable reactive store
The tiny reactive core behind serious state.
Store is a framework-agnostic state primitive for immutable updates, derived values, and targeted subscriptions. It is small enough for library internals and flexible enough for product UI state that should stay reactive without becoming server state.
00.0 MillionTotal Downloads000,000,000Weekly Downloads0GitHub StarsImmutable core
predictable updates and snapshots
Reactive selectors
subscribe to the slice that matters
Adapter friendly
React, Vue, Solid, Svelte, Angular, Lit
ui.theme
subscribed slice
ui.sidebar
subscribed slice
ui.density
subscribed slice
uiStore.setState()
Why Store
Store is not trying to be your server cache, database, or router. It is the small state primitive you reach for when client state needs predictable updates, granular subscriptions, and adapters without a framework-specific runtime.
Store is the tiny reactive primitive that powers parts of the TanStack ecosystem, including framework adapters and library internals.
State transitions are explicit, snapshots are predictable, and derived values can be reasoned about without mutating shared objects in place.
Components can listen to exactly the state they render, so a busy product surface does not need to repaint just because nearby state changed.
Use the adapter for your renderer while the core store stays portable across apps, packages, and UI runtimes.
An action updates store state through a predictable immutable transition.
Computed values can depend on the store without becoming another hand-synced state bucket.
Subscribers choose the exact slice they need for rendering or effects.
Framework adapters bridge the same store into React, Vue, Solid, Svelte, Angular, Lit, or vanilla code.
Store lifecycle
A good store keeps state transitions visible and component subscriptions narrow. Store gives you the primitives without forcing a global architecture on the whole app.
Subscriptions
Filters, editor drafts, selected rows, hover state, panel layout, and derived labels all change at different speeds. Store lets each UI surface subscribe to its own slice.
const filters = useStore(store, state => state.filters)
const canSave = useStore(store, state => state.draft.isDirty)
component
useStore(appStore, state => state.filters)
derived
visibleCount = selectedIds.length
effect
store.subscribe(selector, listener)
adapter
same core, renderer-specific bindings
Framework adapters
The store can live below React, Preact, Solid, Svelte, Vue, Angular, Lit, or vanilla TypeScript. The adapter connects it to the renderer without changing the state model.
Field notes
Store matters because it disappears. It gives TanStack libraries a shared reactive substrate while staying small enough for your own client state.
Open source ecosystem
Maintainers, framework adapters, examples, partners, and GitHub sponsors keep the primitive honest because it has to serve real TanStack packages.