Closed cmeeren closed 7 years ago
If you remove this line, the initial state will not be pushed at first subscription.
If I remember correctly, this test will fail if you remove it.
Maybe I'll push a new version without the Subject to clarify the code, if some people are interested.
Ah, I see, it has to do with the workings of the reactive stuff. Thanks!
What is the point of this line? I.e., what is the point of calling
_stateSubject.OnNext(_lastState);
at the end of theStore
constructor? My understanding is that it calls any subscriber callbacks (like firing an event). However, I assume it's not possible for anyone to subscribe to theStore
before the constructor has finished, so I can't see how it's doing anything.