Releases: pmndrs/zustand
v3.6.4
This improves devtools middleware and typing of other middlewares. Please feel free to update and report any issues.
What's Changed
- feat(middleware): devtools to patch api.setState with namedSet and fix middleware types by @dai-shi in #634
Full Changelog: v3.6.3...v3.6.4
v3.6.3
The new persist middleware exposes persist api in store. This is thanks to the new customizable store api types introduced in v3.6.
What's Changed
- fix(core): useDebugValue in useStore by @dai-shi in #622
- feat(middleware): add persist api by @AnatoleLucet in #624
- refactor(types): prefer type alias by @dai-shi in #625
Full Changelog: v3.6.2...v3.6.3
v3.6.2
v3.6.0 introduced middleware types trying to infer store types as much as possible. However, it doesn't work well for several cases, and users need to type manually which was actually hard. In this version, middleware types are simplified and let users to explicitly type when needed more easily. Many examples are in tests/middlewareTypes.test.tsx
. If you find issues or need some more typing examples, please report them.
What's Changed
Full Changelog: v3.6.1...v3.6.2
v3.6.1
Summary
This fixes some type issues introduced in v3.6.0. devtools
is improved to accept updating state from DevTools Ext.
What's Changed
- fix(context): custom store type for createContext by @dai-shi in #606
- feat(middleware): devtools dispatch support by @Aslemammad in #608
- fix(middleware): types and devtools by @dai-shi in #613
Full Changelog: v3.6.0...v3.6.1
v3.6.0
Summary
This version mainly comes with type improvement for middleware. It's tricky implementation-wise. Please report issues and let's look for solutions or workarounds.
It has renamed and deprecated types: UseStore
π UseBoundStore
A new subscribeWithSelector
middleware is added, deprecating the equivalent feature in core.
Migrating to subscribeWithSelector
middleware
Previously, you could do this:
const useStore = create(...)
useStore.subscribe(callback, selector, equalityFn)
which is deprecated and replaced with:
const useStore = create(subscribeWithSelector(...))
useStore.subscribe(selector, callback, { equalityFn }) // selector is not optional
What's Changed
- feat(types): better middleware support by @dai-shi in #601
- fix(types): Rename from UseStore to UseBoundStore by @dai-shi in #595
- feat(middleware): subscribeWithSelector middleware by @dai-shi in #603
New Contributors
- @benj-dobs made their first contribution in #602
Full Changelog: v3.5.14...v3.6.0
v3.5.14
Summary
Fixed a regression in devtools
that was introduced in v3.5.11.
What's Changed
- fix(middleware): export PersistOptions type definitions by @abraaoz in #588
- fix(middleware): jump state support in devtools by @Aslemammad in #590
New Contributors
Full Changelog: v3.5.13...v3.5.14
v3.5.13
v3.5.12
v3.5.11
This improved devtools
middleware. There can still be room for improvement. Free free to open issues and feature requests, and possibly contribute to them.
v3.5.10
Our fixes for ESM in v3.5.8 and v3.5.9 were somewhat good and somewhat bad. Now, this should be the better one based on our experience and reported issues. If you still have some issues, please file them.