@happy-ts/fetch-t
    Preparing search index...

    Interface FetchRetryOptions

    Options for configuring retry behavior.

    interface FetchRetryOptions {
        delay?: number | ((attempt: number) => number);
        onRetry?: (error: Error, attempt: number) => void;
        retries?: number;
        when?: number[] | ((error: Error, attempt: number) => boolean);
    }
    Index

    Properties

    delay?: number | ((attempt: number) => number)

    Delay between retry attempts in milliseconds.

    Can be a static number or a function for custom strategies like exponential backoff. The function receives the current attempt number (1-indexed).

    0 (immediate retry)
    
    onRetry?: (error: Error, attempt: number) => void

    Callback invoked before each retry attempt.

    Useful for logging, metrics, or adjusting request parameters.

    retries?: number

    Number of times to retry the request on failure.

    By default, only network errors trigger retries. HTTP errors (4xx, 5xx) require explicit configuration via when.

    0 (no retries)
    
    when?: number[] | ((error: Error, attempt: number) => boolean)

    Conditions under which to retry the request.

    Can be an array of HTTP status codes or a custom function. By default, only network errors (not FetchError) trigger retries.