Reputation: 95
Is it ok for a ComponentStore to inject a global store to dispatch actions to the global store?
I have the following scenario:
So, knowing that the child component "A1" will need to trigger an action on child component "B". What's the best approach?
I would appreciate your input on this very much! Thanks!
Upvotes: 2
Views: 1334
Reputation: 15505
It kinda depends (sorry).
If the global store is already used in your application, than option 1 would work. Especially if other parts of the application need to handle that event. On the other hand, you're just creating an event stream, which is similar to option 2, which is a manual event stream.
I would like to propose a third option, a component store that acts as a wrapper and interacts with component store A, and component store B.
Upvotes: 0