Is there a way to maintain continuous polling every 60 seconds in an observable, while also triggering the API call again when a user takes action within the component? How can this be achieved?
Below is my current setup for the polling feature:
this.covidCases$ = timer(1, 60000).pipe(
switchMap(() =>
this.covidService.getCovidCases().pipe(
map(data => {
return data.cases;
}),
),
),
retry(),
shareReplay(1),
);
I then assign this observable to the component:
<case-list [covidCases]="covidCases$"></case-list>