Is @ngrx/store a hot or cold observable?

▼魔方 西西 提交于 2020-08-08 12:24:14

问题


I think that it is a cold observable (as is the default) but couldn't find a reference to it either in the code or the documentation.

(Sorry if this is asked already, couldn't find something)


回答1:


;TLDR It's a hot observable because both ActionSubject and ReducerManager extend BehaviorSubject which is a hot observable.

As stated in the diagram at https://ngrx.io/guide/store

The store receives events from Actions, and Actions are processed via Reducers. Both ActionSubject (the observable of actions) and ReducerManager (the observable of reducer) inherit BehaviorSubject from RxJs library.

The docs and source code are taken from ngrx/store 4.x https://github.com/ngrx/platform/tree/master/modules/store/src

Hope that help.



来源:https://stackoverflow.com/questions/54629140/is-ngrx-store-a-hot-or-cold-observable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!