Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- merge(interval(refreshRateInSeconds * 1000), this.refreshFeed$)
- .pipe(
- takeUntil(merge(this.cancelFeed$, this.stopFeed$)),
- startWith(0),
- switchMap(() => {
- // request do API zwracający Observable'a
- }),
- tap(product => this._product$.next(product)),
- tap(() => this.lastDataUpdate = new Date())
- ).subscribe();
Advertisement
Add Comment
Please, Sign In to add comment