I know we can retry a failed HTTP API request through retry or retryWhen pipe mehtods from rxjs. I want to do something similar on a successful API call, based on a particular condition in the response received.
Any help on this is much appreciated.
It would be better to use the
repeatoperator from RxJs for the successful request because therepeatoperator resubscribes when it receivesonComplete()but not by error. Whereas,retryoperator resubscribes when it receivesonError()Please see this Stackblitz example where a successful request is repeated twice. You can open the console and see the response repeated multiple times.