I use shareReplay
to call only once (like a cache) a webservice to retrieve some informations :
In my service :
getProfile(): Observable<Customer> {
return this.callWS().pipe(shareReplay(1));
}
In multiple components :
this.myService.getProfile().subscribe(customer => {
console.log('customer informations has been retrieved from WS :', customer);
});
Now I want to add a method to force refresh the informations (bypass shareReplay only once). I tried with storing my observable in a variable, and set it to null before re-initialize it, but it seems to break components subscriptions..
Any help ?
Thanks