Skip to content

Releases: pmndrs/zustand

v3.5.0

05 May 15:33
Compare
Choose a tag to compare

This modifies State base type. It's stricter than before and can be a breaking change for TS users. This also adds a new bundle zustand/context which provides a helper function for the usage with React context.

v3.4.2

27 Apr 00:16
Compare
Choose a tag to compare

This includes two small updates.

  • fix(persist middleware): incorrect deserialize type #359
  • feat: add import of store state json to devtools middleware #373

v3.4.1

08 Apr 01:29
Compare
Choose a tag to compare

v3.4.0 has a serious issue in the CJS build. This it to fix it.

v3.4.0

06 Apr 15:40
Compare
Choose a tag to compare

(IMPORTANT: It turns out that this version has a serious issue in CJS build. Please use v3.4.1 instead.)

This release is mainly to change build tooling and package file structure. It now uses esbuild to build esm bundles. The esm bundles are in esm folder, and default cjs bundles are in the root folder.

  • [BREAKING CHANGE] index.cjs.js is renamed to index.js (explicit cjs usage is no longer documented in readme)
  • [BREAKING CHANGE] index.iife.js is removed (never documented and not configured properly)

Changes:

v3.3.3

28 Feb 01:50
Compare
Choose a tag to compare

This improves types for setState in TypeScript.

v3.3.2

16 Feb 22:22
Compare
Choose a tag to compare

This improves persist middleware.

v3.3.1

10 Jan 12:21
Compare
Choose a tag to compare

This patch release fixes an edge case with useLayoutEffect

v3.3.0

08 Jan 10:36
Compare
Choose a tag to compare

[BREAKING CHANGE] Improved persist middleware

See: #275, #258, #254, #251, #246

  • storage options is replaced with getStorage
  • new blacklist / whitelist options
  • new onRehydrateStorage option
  • new version option (data format is changed)

Improved types for TypeScript

v3.2.0

16 Nov 14:37
Compare
Choose a tag to compare

This release improves scoped subscription api (subscription with selector).

[BREAKING CHANGE]
This includes a breaking change in undocumented api and behavior.

Pre-v3.2:

const store = create(...)

store.subscribe((foo, error) => {
  ...
}, state => state.foo)

// errors in the selector are caught and passed as the second argument of the listener.

v3.2:

const store = create(...)

store.subscribe((foo, prevFoo) => {
  ...
}, state => state.foo)

// the second argument of the listener is previous value and errors in the selector are not caught.

v3.1.4

08 Nov 05:52
Compare
Choose a tag to compare

This patch release adds a new persist middleware.