loggedUserobject and a
subscribeto it, providing an Observer, which will start receiving values normally.
BehaviorSubject, which has a notion of "the current value". It stores the latest value emitted to its consumers, and whenever a new Observer subscribes, it will immediately receive the "current value" from the
src/app/app.component.tswe subscribe to this subject, so every time the
loggedUserSubjectemits a value, the AppComponent loggedUser will get notified.