AngularDart with Redux

Issue

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?

Solution

  • 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

Answered By – Günter Zöchbauer

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *