MyGit

v3.6.0

pmndrs/zustand

版本发布时间: 2021-10-21 22:09:21

pmndrs/zustand最新发布版本:v5.0.0-rc.2(2024-09-15 11:17:18)

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

New Contributors

Full Changelog: https://github.com/pmndrs/zustand/compare/v3.5.14...v3.6.0

相关地址:原始地址 下载(tar) 下载(zip)

查看:2021-10-21发行的版本