Packages

zustand

5.0.16 · 22 Oct 2026MIT87.8M / weekRepositorynpmAtom feed

Your version

3.2.0

16 Nov 2020Where it was published

3.7.2 is the newest release of 3.x.

In short

1 breaking1 changed

  • breaking

    [BREAKING CHANGE]

Release note

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.