rxjsRetry and RetryWhen Operators


Introduction

Retry and RetryWhen can be used to attempt to recover Observables that might have errors in their stream.

Syntax

  1. .retry(n: number): Observable
    • n: retry will attempt the source Observable this many times.
  2. .retryWhen(receives: notificationHandler, the: scheduler): Observable
    • receives: an Observable of notifications which the use can complete or error.
      • If the 'receives' Observable returns cleanly (completes) the source Observable will be reattempted.
      • If the 'receives' Observable returns an error, the source Observable is aborted.
    • scheduler: The source Observable is subscribed to this scheduler.