So I am trying to have a boolean be true if the function running runs long enough to trigger the takenUntil function which is running on a timer.
Here is the code
start = this.http.get(environment.shochat_content_creator_set_valid_stream_start).pipe(
tap(() => console.log('Stream start'))
);
poll = this.http.get(environment.check_if_stream_is_active_on_mux).pipe(
tap(() => {
this.streamready = true;
return 0;
}
),
catchError(error => {
console.log(error);
return EMPTY;
})
);
startastream(){
const endtimer = timer(60000);
this.streampollsubscription = this.start.pipe(
switchMap(() => timer(0, 5000).pipe(
tap(() => console.log('Polling every 5s')),
mergeMap(() => this.poll)
)),
takeUntil(endtimer)
).subscribe();
}
essentially i want a boolean to be set to true if the takeUntil does get fired.
timeout = true;
I have been looking at this stackoverflow post
Do some action after takeUntil
but things are not as clear as I want it to be.