Skip to content

Releases: pmndrs/zustand

v3.6.6

03 Dec 13:28
Compare
Choose a tag to compare

This fixes and improves devtools middleware. The basic usage shouldn't be changed. If you have questions on usage, please open a new discussion.

What's Changed

New Contributors

Full Changelog: v3.6.5...v3.6.6

v3.6.5

09 Nov 14:08
Compare
Choose a tag to compare

This version further improves to fix some typing issues introduced in v3.6.0 and fixes persist api introduced in v3.6.3.

What's Changed

  • fix(types): fix core types to better handle middleware types by @dai-shi in #641
  • feat(middleware): add onFinishHydration to persist api by @AnatoleLucet in #646

Full Changelog: v3.6.4...v3.6.5

v3.6.4

03 Nov 22:50
Compare
Choose a tag to compare

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

02 Nov 12:23
Compare
Choose a tag to compare

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

Full Changelog: v3.6.2...v3.6.3

v3.6.2

30 Oct 00:52
Compare
Choose a tag to compare

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

  • fix(middleware): simplify middleware types and allow explicit typing by @dai-shi in #617

Full Changelog: v3.6.1...v3.6.2

v3.6.1

26 Oct 15:44
Compare
Choose a tag to compare

Summary

This fixes some type issues introduced in v3.6.0. devtools is improved to accept updating state from DevTools Ext.

What's Changed

Full Changelog: v3.6.0...v3.6.1

v3.6.0

21 Oct 14:09
Compare
Choose a tag to compare

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

Full Changelog: v3.5.14...v3.6.0

v3.5.14

19 Oct 11:43
Compare
Choose a tag to compare

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

07 Oct 12:54
Compare
Choose a tag to compare

The persist middleware has a new option partialize which works for nested properties, deprecating blacklist and whitelist options.

  • #463 feat(persist): add partialize option

v3.5.12

01 Oct 13:34
Compare
Choose a tag to compare

v3.5.11 accidentally requires newer node.js versions. v3.5.12 fixes it by reverting exports format.

  • #578 fix(package): avoid subpath pattern in exports