Why you use new ReplaySubject<boolean>(1)?
Closed this issue · 1 comments
josecarballosa commented
What are the benefits of using 1" vs "true" for the initial value of the BehaviorSubject instance in this line?
What puzzles me more is that the tutorial uses value "false" instead for this same line here:
josecarballosa commented
Ok, it turns out that "1" is not the initial value of the observable; because it is a ReplaySubject, not a BehaviorSubject. So the "1" says store and replay one value from the stream (the last one). There is no initial value with ReplaySubject.