With working code and examples!

Turns out, retry operator, like many others subscribes to the observable that it is applied on.
What’s different is that retry works on the error case. On the error case it re-subscribes to the source observable as many times as attempts it was given.

So retry(2) will listen for error and retry once, then listen for another error and retry a second time and then on the third error it will give up and let the error bubble up to your error handler.

For more details, code, and step by step head over https://www.educative.io/edpresso/what-is-the-rxjs-retry-operator-and-how-does-it-work

Georgi Parlakov

Angular and DotNet dev. RxJs explorer. Testing proponent. A dad. https://gparlakov.github.io/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store