angular-basics-seed icon indicating copy to clipboard operation
angular-basics-seed copied to clipboard

Use retryWhen() to Delay Retries

Open hazartilirot opened this issue 2 years ago • 0 comments

Actually, retryWhen is deprecated. https://rxjs.dev/api/operators/retryWhen

read(): Observable<Donut[]> {
    return this.donuts.length ?
      of(this.donuts) :
      this.httpClient
          .get<Donut[]>(`/api/donuts`)
          .pipe(
            tap(donuts => this.donuts = donuts),
            retry({count: 10, delay: 5000}), // use this operator instead
            catchError(this.handleError)
          );
  }

hazartilirot avatar Jun 10 '23 11:06 hazartilirot