From 2ca681feaebab1c4a2598f478e2b370b44415af5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 22 Apr 2022 09:34:51 +0000 Subject: [PATCH] Version Packages --- .changeset/witty-games-raise.md | 33 -------------------------------- packages/zustood/CHANGELOG.md | 34 +++++++++++++++++++++++++++++++++ packages/zustood/package.json | 2 +- 3 files changed, 35 insertions(+), 34 deletions(-) delete mode 100644 .changeset/witty-games-raise.md diff --git a/.changeset/witty-games-raise.md b/.changeset/witty-games-raise.md deleted file mode 100644 index ec71008..0000000 --- a/.changeset/witty-games-raise.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -"@udecode/zustood": minor ---- - -`react-tracked` support - -Use the tracked hooks in React components, no providers needed. Select your -state and the component will trigger re-renders only if the **accessed property** is changed. Use the `useTracked` method: - -```tsx -// Global tracked hook selectors -export const useTrackedStore = () => mapValuesKey('useTracked', rootStore); - -// with useTrackStore UserEmail Component will only re-render when accessed property owner.email changed -const UserEmail = () => { - const owner = useTrackedStore().repo.owner() - return ( -
- User Email: {owner.email} -
- ); -}; -// with useStore UserEmail Component re-render when owner changed, but you can pass equalityFn to avoid it. -const UserEmail = () => { - const owner = useStore().repo.owner() - // const owner = useStore().repo.owner((prev, next) => prev.owner.email === next.owner.email) - return ( -
- User Email: {owner.email} -
- ); -}; -``` diff --git a/packages/zustood/CHANGELOG.md b/packages/zustood/CHANGELOG.md index c91910d..3d5e056 100644 --- a/packages/zustood/CHANGELOG.md +++ b/packages/zustood/CHANGELOG.md @@ -1,5 +1,39 @@ # @udecode/zustood +## 1.1.0 + +### Minor Changes + +- [#36](https://github.com/udecode/zustood/pull/36) [`c66963c`](https://github.com/udecode/zustood/commit/c66963c6fd56ec91d2d658421499a701742bfb69) Thanks [@ShinyLeee](https://github.com/ShinyLeee)! - `react-tracked` support + + Use the tracked hooks in React components, no providers needed. Select your + state and the component will trigger re-renders only if the **accessed property** is changed. Use the `useTracked` method: + + ```tsx + // Global tracked hook selectors + export const useTrackedStore = () => mapValuesKey('useTracked', rootStore); + + // with useTrackStore UserEmail Component will only re-render when accessed property owner.email changed + const UserEmail = () => { + const owner = useTrackedStore().repo.owner(); + return ( +
+ User Email: {owner.email} +
+ ); + }; + // with useStore UserEmail Component re-render when owner changed, but you can pass equalityFn to avoid it. + const UserEmail = () => { + const owner = useStore().repo.owner(); + // const owner = useStore().repo.owner((prev, next) => prev.owner.email === next.owner.email) + return ( +
+ User Email: {owner.email} +
+ ); + }; + ``` + ## 1.0.0 ### Major Changes diff --git a/packages/zustood/package.json b/packages/zustood/package.json index 762da37..41ac3cb 100644 --- a/packages/zustood/package.json +++ b/packages/zustood/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/zustood", - "version": "1.0.0", + "version": "1.1.0", "description": "A modular store factory using zustand", "keywords": [ "zustand"