release notes
release notes
Published 10/21/2021
MinorContains new featuresThis 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.
subscribeWithSelector middlewarePreviously, 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
Full Changelog: https://github.com/pmndrs/zustand/compare/v3.5.14...v3.6.0
release notes
Published 10/21/2021
MinorContains new featuresThis 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.
subscribeWithSelector middlewarePreviously, 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
Full Changelog: https://github.com/pmndrs/zustand/compare/v3.5.14...v3.6.0
🐻 Bear necessities for state management in React