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

    @happy-ts/fetch-t

    import { fetchT, FetchError, ABORT_ERROR, TIMEOUT_ERROR } from '@happy-ts/fetch-t';

    // Basic usage
    const result = await fetchT('https://api.example.com/data', {
    responseType: 'json',
    });

    result
    .inspect((data) => console.log(data))
    .inspectErr((err) => {
    if (err instanceof FetchError) {
    console.error('HTTP Error:', err.status);
    } else if (err.name === TIMEOUT_ERROR) {
    console.error('Request timed out');
    } else if (err.name === ABORT_ERROR) {
    console.error('Request was aborted');
    }
    });

    Classes

    FetchError

    Interfaces

    FetchInit
    FetchProgress
    FetchRetryOptions
    FetchTask

    Type Aliases

    FetchResponseData
    FetchResponseType
    FetchResult

    Variables

    ABORT_ERROR
    TIMEOUT_ERROR

    Functions

    fetchT