如何从ngrx store中获取Observable对象

Actions描述了从Components和services dispatch出来的unique events.数据结构

counter$: Observable;app


这个store的初始化不须要应用开发人员操心,直接经过构造函数参数的方式注入:ide

尖括号后的fromExample.State就是包含业务逻辑的数据结构。函数

store.select方法里须要传一个memoized selector:fromExample.getCounterCounterspa

getCounterCounter这个选择器 又是经过另外一个选择器和mapping function经过createSelector加工而成的。Mapping函数通常是将总体State映射成具体业务须要的字段。blog

getCounterState:开发

这个getExampleState就是feature selector了,经过另外一个方法createFeatureSelector建立:get

最后也是最重要的一步,必定要将feature selector同reducers经过StoreModule.forFeature创建绑定关系,下面24行意思是将咱们本身实现的reducers注册到feature selector example上去。it

相关文章
相关标签/搜索