Skip to content

Instantly share code, notes, and snippets.

View CaptainCodex's full-sized avatar
🎯
Focusing

Grant Dawson CaptainCodex

🎯
Focusing
View GitHub Profile
// Credit: https://www.learnrxjs.io/operators/error_handling/retrywhen.html.
import { throwError, timer } from 'rxjs';
import { ajax } from 'rxjs/ajax';
import { finalize, mergeMap, retryWhen } from 'rxjs/operators';
const genericRetryStrategy = ({
maxRetryAttempts = 3,
scalingDuration = 5000
} = {}) => errors =>