A JavaScript API retry pattern
Taking an object literal used as a wrapper around an API service.
With an API service that returns a limit response such as Promise.reject(new Error('Quota limit exceeded'))
.
One approach for a retry mechanism is to use a Proxy
handler for each method.
And to apply the handler.
The count
variable could be used as part of the wait time calculation to switch to an exponential backoff implementation.
Read other posts