Skip to content

Use retryWhen() to Delay Retries #3

@hazartilirot

Description

@hazartilirot

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)
          );
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions