fetrest
    Preparing search index...

    Type Alias FROptions

    Client options.

    type FROptions = {
        baseUrl: string;
        fetchFn?: FetchFn;
        fetchOpts?: RequestInit;
        hooks?: { afterRequest?: FRHook; beforeRequest?: FRHook };
        logs?: boolean;
        retryCount?: number;
        retryDelayMs?: number;
        retryOn?: number[];
    }
    Index

    Properties

    baseUrl: string

    /**

    • base url for the client
    fetchFn?: FetchFn

    Override fetch function

    You can specify a fetch like function to be called, instead of fetch global function.

    Note: This will get overriden if specified FRRequestOptions.fetchFn.

    fetchOpts?: RequestInit

    default fetch options. * Fetch options those will be passed to every request

    hooks?: { afterRequest?: FRHook; beforeRequest?: FRHook }

    hooks for request lifecyle. * NOTE: They're not interceptors

    logs?: boolean

    enable logging

    false
    
    retryCount?: number

    number of retries in case of failure. * This bounds to FROptions.retryOn - if retryOn is not specified (or empty array), it will not retry at all *

    0
    
    retryDelayMs?: number

    Delay (in milliseconds) between each retry.

    1000 1-second
    
    retryOn?: number[]

    Status codes to follow for retries. This bounds to FROptions.retryCount - if retryCount is not specified (or less than 1), it will not retry at all

    []