-
|
Hi, Imagine a store in which there are many properties and the functional components of the entire application use these properties using: Imagine that there are roughly 200 components (mostly repeating) each using dozens of properties from this one store. So my 1st question is: could it be a performance issue to figure out which components to render when one property changes? E.g. property1? I think yes. So what if we split the store using the slices pattern: https://github.com/pmndrs/zustand/blob/main/docs/guides/slices-pattern.md Is it right? So my 2nd and main question is: is physical separation into completely different stores the solution to this possible performance problem? Thanks a lot for any answer. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Using multiple stores instead of one combined store can improve performance. (It's often called "scoped subscriptions") |
Beta Was this translation helpful? Give feedback.
Using multiple stores instead of one combined store can improve performance. (It's often called "scoped subscriptions")
But, whether it will be a bottleneck or not is questionable. Often the case, it's premature optimization. You want to measure it in a practical setup and compare.