udecode / zustand-x

Zustand store factory for a best-in-class developer experience.
https://zustand-x.udecode.dev
MIT License
328 stars 20 forks source link

Allow deleting properties from state #22

Closed xuanduc987 closed 2 years ago

xuanduc987 commented 2 years ago

Description

plate tried to remove editor state on unmount (https://github.com/udecode/plate/blob/ebc85b088c18a1c7e67fa9ed9ec78de7772898fa/packages/core/src/stores/plate/platesStore.ts#L28-L30) but the state was not deleted.

The reason is by default, zustand set tries to merge state instead of replacing old state with the new one. Set the second agrument of set to true would fix this problem.

changeset-bot[bot] commented 2 years ago

🦋 Changeset detected

Latest commit: 196501fc4ce52fa85b6433b5e9b0782ca302cb1e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------------- | ----- | | @udecode/zustood | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

zbeyens commented 2 years ago

Good catch, thanks for the PR!