AngularDart 与 Redux
AngularDart with Redux
在检查 redux.dart 和 built_redux 以及从 angulardart 开始的文档时,我看到 "connecting" 从我的应用程序中的任何组件到商店的两种不同方式:
- 在服务中实例化存储对象,然后注入任何组件并选择我们关心的子状态
- 实例化到根组件中,然后通过 @Input() 字段将状态和调度程序传递给子组件。
所以我很困惑,其中哪一种(或其他方式?)最有效并且会给我正确的舞台管理?
- 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
在检查 redux.dart 和 built_redux 以及从 angulardart 开始的文档时,我看到 "connecting" 从我的应用程序中的任何组件到商店的两种不同方式:
- 在服务中实例化存储对象,然后注入任何组件并选择我们关心的子状态
- 实例化到根组件中,然后通过 @Input() 字段将状态和调度程序传递给子组件。
所以我很困惑,其中哪一种(或其他方式?)最有效并且会给我正确的舞台管理?
- 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