on-internet
← Community

how to use angular service inside rxjs retryWhen method

Stack Overflow ·

I am making the http service calls 3 times when I get 401 error using the retryWhen method form Rxjs operators. My problem is that when I get a 401 error status, I need to make the other service update the token and then re-try the http service call 3 times. I am unable to use the service inside retryWhen call back method as it is always showing this as undefined. Can you please provide a solution for this? return this.http.get(url, this.getOptions(options)).retryWhen(errors => { return errors.mergeMap((error) => { console.error('error status....', this, error, error.status); if (error.status

Comments

Sign in or sign up to comment and upvote.

No comments yet.