fn

retryPlugin

v0.0.1

Retries failed attempts based on status code, respecting retry / retryDelay / retryStatusCodes request options. Auto-registered by createFetch; disable per-request via retry: false.

Signature

ts
export function retryPlugin(){ ... }

Returns

FetchPlugin<"retry", unknown, unknown>
PropertyTypeDescription
nameNamePlugin identifier
defaults?FetchOptionsDefault options contributed by the plugin — merged under user defaults
hooks?FetchHooksLifecycle hooks executed before any user per-request hooks
execute?FetchExecuteMiddlewareOnion-style middleware wrapping the fetch attempt + response parse. Plugins compose in registration order; calling next() invokes the next middleware or ultimately the core executor. May call next() multiple times (e.g. to implement retries).
setup?(context: { readonly defaults: FetchOptions }) => voidInvoked once per createFetch, after all plugin defaults are merged
__types?{ options: OptionsExt; context: ContextExt }Phantom marker for type-only option/context extensions — never present at runtime. Populated via dummy field in definePlugin generics.