spygi
spygi

Reputation: 442

Is @ngrx/store a hot or cold observable?

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)

Upvotes: 3

Views: 1125

Answers (1)

LxL
LxL

Reputation: 1948

;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 Ngrx state management lifecycle

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.

Upvotes: 5

Related Questions