Skip to content

Importing RootStore instead of Provider #2677

Answered by kubk
gravitymedianet asked this question in Q&A
Discussion options

You must be logged in to vote

From my experience, stores-singletons could be used in case you don't have SSR and don't write unit tests. With SSR your store will be shared among all the users (because the server starts only once and your store stays the same in module between different users). For unit tests, it may be difficult to always restore the store state between test cases. Again, because the instance of a global store is shared among test cases. In other cases, it works OK.

Replies: 3 comments 7 replies

Comment options

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

Comment options

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

Comment options

You must be logged in to vote
5 replies
@gravitymedianet
Comment options

@danielkcz
Comment options

@gravitymedianet
Comment options

@danielkcz
Comment options

@gravitymedianet
Comment options

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