I have a service which exposes a function that returns Observable. In this service I have some logic which should trigger a next call on the Observable so that subscribed component should get the updated data. During Observer constructor I can call next and everything works great, but how can I access this outside of the constructor?
During service init I do
private currentWheaterData$: Observable<any>;
this.currentWheaterData$ = new Observable(observer => {
observer.next(/* data */);
}
Then in other methods of the same service I want to be able to execute something like
this.currentWheaterData$.observer.next(/* fresh data */);
There must be a way to emit a new data.