Reducer: 纯粹的函数,接收当前状态,以及最新的action,计算出最新的action.
selector: 纯函数,用于select,derive和compose pieces of state
Store和State的区别
State is accessed with the store, an observable of state and an observer of actions.
Store是state和action的Observable.
reducer第一次被系统调用:@ngrx/store/update-reducers:

type:@ngrx/store/update-reducers
store也是一个Observable:
上一次的action:
store的source字段里,根据feature名称example找到state初始值0:
下面再观察store.select的执行:
source$就是应用的this.store:
scheduler.js:
注意,一旦调用了flush方法之后,我们的reducer被回调:
action导致counter值变为1之后,需要通知subscriber: