Zustand
Changelog
Release notes for @homeostate/store-zustand: what changed in each version, newest first.
0.3.0
Minor Changes
-
3b9d6dc: Breaking: the
homeostatemiddleware takes the state creator first and its options second, as Zustand's own middlewares do.homeostate(creator, { backend, ...config })replaceshomeostate(backend, creator, config): move the backend into the options, next tofilter,seed,scheduleandonError. Withpersist, writehomeostate(persist(creator, options), { backend }). Calling the middleware with the backend first throws aTypeErrornaming the new order. The options type is exported asHomeostateOptions.connect: "manual"creates the store without reading or writing the backend and leavesstore.homeostate.connect()to the app, for example once its provider has received the room's state or its document persistence has loaded. Astore.homeostate.connect()made beforepersisthas hydrated the store waits for the hydration, with either connect mode, instead of connecting at once. -
fbc31b4: The
homeostatemiddleware works with Zustand'spersistplaced inside it,homeostate(persist(creator, options), { backend }), including with asynchronous storage. The store connects oncepersisthas hydrated it, so a room with state wins over the persisted state instead of being overwritten by it, and persisted state still seeds an empty room. Until thenstore.homeostate.isConnected()isfalse, anddisconnect()cancels the pending connect. Withpersistoutside the middleware, which overwrote the persisted state with the creator's, creating the store now throws an error naming the right order. -
7e7171a: The
homeostatemiddleware takes the engine's newkeysandomitoptions, checked against the store's state:homeostate(creator, { backend, omit: ["draft"] })keeps a key local, and a misspelled key fails to compile.HomeostateOptionsis generic,HomeostateOptions<T>, and typesfilterby the state too.
Patch Changes
- cde0b51:
store.homeostateforwards the engine's newsubscribeandgetSyncedState. - Updated dependencies [39809d7]
- Updated dependencies [a80be3b]
- Updated dependencies [60331b4]
- Updated dependencies [567932b]
- Updated dependencies [55812ce]
- Updated dependencies [d2a66d8]
- Updated dependencies [8ed9541]
- Updated dependencies [ceca144]
- Updated dependencies [3bdd635]
- Updated dependencies [9a6e0c6]
- Updated dependencies [aa7cbc1]
- Updated dependencies [3b9d6dc]
- Updated dependencies [9ce5ff0]
- Updated dependencies [cde0b51]
- Updated dependencies [074eadc]
- Updated dependencies [7e7171a]
- @homeostate/core@0.4.0
0.2.1
Patch Changes
- 379ef4a: Fix the JSDoc examples shown in editor tooltips. The
homeostateexample now uses the curriedcreate<T>()(...)form, sincecreate(homeostate(...))types the state asobject, and thecreateZustandAdapterexample lists its imports. - Updated dependencies [732c2c8]
- Updated dependencies [f901667]
- Updated dependencies [d858951]
- Updated dependencies [f77d8a6]
- Updated dependencies [29f8f0d]
- Updated dependencies [456fbad]
- Updated dependencies [30e31df]
- Updated dependencies [314e268]
- Updated dependencies [4564712]
- Updated dependencies [d8e9906]
- Updated dependencies [008091c]
- @homeostate/core@0.3.0
0.2.0
Minor Changes
- 81d1d18: Stop exporting the adapter classes (
JotaiAdapter,MobxAdapter,MobxStateTreeAdapter,ReduxAdapter,TanStackStoreAdapter,ValtioAdapter,ZustandAdapter); create adapters with thecreate*Adapterfactories, which now carry the adapter docs and examples.
Patch Changes
- 33c7b14: Mark the package side-effect free, so bundlers can drop modules that are not imported.
- Updated dependencies [a643bbe]
- Updated dependencies [0bbf653]
- Updated dependencies [fb76f77]
- @homeostate/core@0.2.0
0.1.2
Patch Changes
- 30abf27: Remove draft release warnings, update docs links
- Updated dependencies [30abf27]
- @homeostate/core@0.1.2
0.1.1
Patch Changes
- 8bd452e: Init release
- Updated dependencies [8bd452e]
- @homeostate/core@0.1.1