I have the following initialization at the top of my angular component.
public myDataObservable$: Observable<MyData[]>;
Somewhere in my component I make the following call to an Ngrx store using a selector to get back data for the observable. All of this works fine and I get the data back I wanted.
this.myDataObservable$ = this.store.pipe(select(MyDataStore.getMyData));
I need to know when this observable completes. I need to set a boolean that will turn off a loading indicator when all of the data the observable is trying to get finishes. This is done through a web service.
Because the source of the observable comes from somewhere else I cannot hang a 'complete' call back () => {this.loadingIndicator = false} like this.
I have tried various Rxjs operators such as TakeUntil and Finalize with no luck. These operators get called right away and my loading indicator shuts off as fast as it went up.
I scoured the internet and tried many different solutions but I cannot find an answer. Thanks for taking the time to look at this.
this.myDataObservable$ = this.store.pipe(select(MyDataStore.getMyData), tap(() => this.loading = false))- BizzyBobskip(1)to ignore the first emission. - BizzyBob