Retry an async operation up to N times, doubling the wait each attempt with random jitter to avoid thundering herd. Predicate controls retryability so 4xx errors stop immediately.
Wrap any HTTP call in a retry loop with capped exponential backoff and jitter. Retries on 5xx / network errors but not on 4xx (those won't fix themselves).
TypeScript Retry with Exponential Backoff + Jitter
Retry an async operation up to N times, doubling the delay each attempt with random jitter to avoid thundering herd. Decide retryability via an optional predicate so 4xx errors stop immediately.
Generic retry decorator: attempts × base delay, exponential ramp, random jitter. Filter retryable exceptions via the `on` tuple so logical errors aren't retried.