2
votes

While checking the documentation for both redux.dart and built_redux and as of angulardart, I've seen two different ways of "connecting" to the store from any component in my app:

  • Instantiating a store object in a service and then injecting in any component and selecting the substate we care about
  • instantiating into the root component and then passing state and dispatchers to the children through @Input() fields.

So I'm quite confused, which one of these (or other way?) is the most efficient and will give me correct stage management?

1

1 Answers

3
votes
  • instantiating into the root component and then passing state and dispatchers to the children through @Input() fields.

This is technically possible but seems weird, cumbersome ans inefficient.

Using dependency injection is the way to go in Angular:

  • Instantiating a store object in a service and then injecting in any component and selecting the substate we