From 737241bd59b776de676ed8df81600944a8f538e0 Mon Sep 17 00:00:00 2001 From: Michael Di Prisco Date: Thu, 29 Feb 2024 18:10:54 +0100 Subject: [PATCH 1/2] docs: adding note about middlewares and slices --- docs/guides/slices-pattern.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/guides/slices-pattern.md b/docs/guides/slices-pattern.md index b3c0580156..a9a572ffe6 100644 --- a/docs/guides/slices-pattern.md +++ b/docs/guides/slices-pattern.md @@ -113,6 +113,8 @@ export const useBoundStore = create( ) ``` +Please, keep in mind you should apply middlewares only in the combined store and avoid applying them inside individual slices to prevent issues. + ## Usage with TypeScript A detailed guide on how to use the slice pattern in Zustand with TypeScript can be found [here](./typescript.md#slices-pattern). From 0d2845302f84ca8fd8df5eedf3ce8f79d244ccb6 Mon Sep 17 00:00:00 2001 From: Michael Di Prisco Date: Fri, 1 Mar 2024 14:02:48 +0100 Subject: [PATCH 2/2] chore: updating slices note Co-authored-by: Blazej Sewera --- docs/guides/slices-pattern.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/slices-pattern.md b/docs/guides/slices-pattern.md index a9a572ffe6..c006bc93ae 100644 --- a/docs/guides/slices-pattern.md +++ b/docs/guides/slices-pattern.md @@ -113,7 +113,7 @@ export const useBoundStore = create( ) ``` -Please, keep in mind you should apply middlewares only in the combined store and avoid applying them inside individual slices to prevent issues. +Please keep in mind you should only apply middlewares in the combined store. Applying them inside individual slices can lead to unexpected issues. ## Usage with TypeScript