btroncone / learn-rxjs

Clear examples, explanations, and resources for RxJS

Home Page:https://www.learnrxjs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The example of retryWhen is not working as expected

kimamula opened this issue · comments

The second example of retryWhen does not actually retry this._appService.getData(500).
I have confirmed this by inserting console.log('getData', status); into the getData method in the StackBlitz example

https://www.learnrxjs.io/operators/error_handling/retrywhen.html

The following code works.

of(true, async).pipe(
  flatMap(() => this._appService.getData(500)),
  retryWhen(genericRetryStrategy()),
  catchError(error => of(error))
).subscribe(console.log);

Closing - cleaning up old issues.