Is there any risk in registering the ComponentStore at the root level? #3498
Unanswered
lichunbin814
asked this question in
Q&A
Replies: 2 comments 10 replies
-
I’m using it in multiple apps, this approach successfully works even with standalone components. |
Beta Was this translation helpful? Give feedback.
10 replies
-
There's no risk into using component-store as a global store. Projects have different needs, and teams have their own preferences. @ngrx/component-store started as a store for components, but I see more projects using it also as a global store, or in combination with @ngrx/store. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I saw the article, they put the componentStore at the root level as a global store, which is convenient for development and can work normally.
However, in the NgRx documentation, @NgRx/Store is still used as an example if you want to manage global state.
In my opinion, it seems correct to regard componentStore as a global service, but it conflicts with the design concept of ComponentStore. I don't know if there are any objections. Do you have any opinion?
Beta Was this translation helpful? Give feedback.
All reactions