AngularDart 与 Redux

AngularDart with Redux

在检查 redux.dart 和 built_redux 以及从 angulardart 开始的文档时,我看到 "connecting" 从我的应用程序中的任何组件到商店的两种不同方式:

所以我很困惑,其中哪一种(或其他方式?)最有效并且会给我正确的舞台管理?

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

这在技术上是可行的,但看起来很奇怪、麻烦而且效率低下。

使用依赖注入是 Angular:

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