github pmndrs/zustand v2.0.0

latest releases: v5.0.0-alpha.6, v5.0.0-alpha.5, v5.0.0-alpha.4...
4 years ago
  • Removed ESM and IIFE versions of middleware.js and shallow.js. Any imports of the ".cjs" files should be changed from "zustand/{name}.cjs" to just "zustand/{name}" as they are all CommonJS now (index.js still has different formats).
  • api.subscribe has a new function signature that removes the object wrapper: api.subscribe(listener, selector?, equalityFn?).
  • StateListener type has changed. An overloaded signature was added for better error handling.
  • Subscribe type has changed. It uses the updated StateListener type.
  • listeners are iterated in a different order than they were before. Parent to child rather than child to parent. It would be rare if this causes any issues.
  • The automatic fix when passing an array as the second arg of useStore was removed. useStore will throw an Uncaught TypeError if the second arg is an array.

Don't miss a new zustand release

NewReleases is sending notifications on new releases.