This operator again lets you execute an observable a given number of times in the presence of an error. The most common use case is to do an HTTP call to a resource and retry a couple of times if an error happens. The retry() operator has the following signature:
It receives only one parameter:
- retryAttempts: This is a number indicating the number of times this observable must be retried.
To test this operator we will try to fetch the Google search page and retry it three times before propagating the error (you can change the Google page for any other URL). To do so, we will use the request-promise library, which fetches a URL using promise(), and then use the fromPromise() method ...