A decorator for the Fetch API (native, isomorphic-fetch, cross-fetch) that adds configurable automatic retry logic with support for timeouts, AbortController, JWT token refresh via beforeRefetch callback, and status-code-based skip logic. Version 1.4.1 is stable with TypeScript declarations included. Differentiators: lightweight (no dependencies), promise-based retry with max count, timeout between retries, and a flexible beforeRefetch hook for modifying requests on each attempt.
npm install retry-my-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup with max retries, timeout, and status code exclusions using TypeScript types.
Access the parameter as retryConter (the actual name used in the source), or rename in your code for clarity
Use timeout for inter-retry delay; for total timeout, combine with AbortSignal.timeout()
Do not pass your own signal if useAbortController is true; the library manages the signal
Ensure the value is a plain array of numbers, e.g., [400, 401]
Use import retryMyFetch from 'retry-my-fetch' or dynamic import()
Install the package: npm install retry-my-fetch (types are bundled)
Use correct property names: maxTryCount, timeout, beforeRefetch, etc.
Configure timeout appropriately or avoid using abort signals that may fire during retries
No dependency data recorded yet.