I need to create a SessionService which will contain information about user and should act as a singleton across all components.
I would use it like:
this.sessionService.user$.subscribe(_ => {
this.greetingsName = _.firstName;
});
It should be lazy loading: first call should get data over http and store it somewhere, any other subscription should replay this stored data.
Can you advice any technique / pattern / best practice for this in Angular / RxJS ?
Thanks!