Migration reference
Most recent first. Release links: releases.
0.11.0 -> 0.11.1
Patch only. Core @tanstack/store@0.11.1 inlines reactive flag constants for tree-shaking (#350). No adapter API changes. Release
0.10.x -> 0.11.x
Release 0.11.0, hooks added in #306.
- Replace
useStore(store, selector)withuseSelector(store, selector).useStoreremains as a deprecated alias. - Compare changes:
- Pre-0.11
useStoredefaulted toshallowequality and accepted an{ equal }options object. In 0.11.x the default is strict===(src/useSelector.ts:15-17) and the option is{ compare }insideUseSelectorOptions. - If the deprecated
useStoreis kept, its third argument is a barecomparefunction, not an options object (src/useStore.ts:14-23). - Selectors that build objects or arrays must add
{ compare: shallow }explicitly, or the ref updates on every notification.
- Pre-0.11
- New hooks:
useAtom(atom, options?)returns[readonly Ref, atom.set]; experimental_useStore(store, selector, options?)returns[selected, actions or setState]. createStoreContextappears in the release notes but is not exported by the published 0.11.1 source. Do not import it.
0.9.x -> 0.10.0
Build system only: build switched to tsdown (#304). No public API changes. Release
<=0.8.x -> 0.9.0
Release 0.9.0, breaking changes in #265.
new Store()->createStore().new Derived()-> a derivedcreateStore(() => ...)returningReadonlyStore.new Effect()removed ->store.subscribe(() => { ... }), which returns{ unsubscribe }.- Internals switched to alien-signals for reactivity.
// before
const store = new Store({ count: 0 })
const derived = new Derived(() => store.state.count * 2)
const effect = new Effect(() => console.log(store.state.count))
// after
const store = createStore({ count: 0 })
const derived = createStore(() => store.state.count * 2)
const { unsubscribe } = store.subscribe((s) => console.log(s.count))