fn
retryPlugin
v0.0.1Retries 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>| Property | Type | Description |
|---|---|---|
name | Name | Plugin identifier |
defaults? | FetchOptions | Default options contributed by the plugin — merged under user defaults |
hooks? | FetchHooks | Lifecycle hooks executed before any user per-request hooks |
execute? | FetchExecuteMiddleware | Onion-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 }) => void | Invoked 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. |