kit
    Preparing search index...

    Type Alias ClientOptions

    type ClientOptions = {
        fetchFn?: typeof fetch;
        headers?: RequestInit["headers"];
        log?: 0 | 1;
        processErr?: ResponseProcessorErr;
        processReq?: RequestProcessor;
        processRes?: ResponseProcessorRes;
        request?: Omit<RequestInit, "body" | "headers" | "method">;
        throwErr?: boolean;
        timeout?: number | false | null;
    }
    Index
    fetchFn?: typeof fetch

    Optionally override the fetch function

    fetch - The standard fetch

    headers?: RequestInit["headers"]

    Headers will be merged with

    { "content-type": "application/json" }
    
    {}
    
    log?: 0 | 1

    Log level:

    • 0: silent
    • 1: ok/fail logging
    0
    
    processErr?: ResponseProcessorErr

    Process maybe-thrown error originated either from fetch function invokation or from its response.json() parsing

    undefined
    
    processReq?: RequestProcessor

    Process request before actual http call

    undefined
    
    processRes?: ResponseProcessorRes

    Process ok/failed response just after http response

    undefined
    
    request?: Omit<RequestInit, "body" | "headers" | "method">

    Basic request options to supply to fetch

    RequestInit

    {}
    
    throwErr?: boolean

    Flag to throw error within the catch block, by default we return a normalised error result ResultFail

    false
    
    timeout?: number | false | null

    Timeout in ms, if falsy there is no timeout

    10000