Skip to content

State composition for different pages/roles, dynamic state #735

Answered by dai-shi
rootical asked this question in Q&A
Discussion options

You must be logged in to vote

the library will serve its best by having one application state

I wouldn't say so. Zustand is more for a global store, but Valtio is said to be rather atomic.

Is there a crucial difference in which exact snapshot to use (shall it always be the "app state")?

Technically, it's better to use smaller one ("adminState"), because it's more scoped subscription. Theoretically, it's more efficient, but in terms of React render optimization, it wouldn't be the bottleneck.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rootical
Comment options

Answer selected by rootical
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants