@grafctory/http - v0.9.0
    Preparing search index...

    Module resolve

    Uniform failure answering middleware.

    Answers every failed exchange of the wrapped Fetch implementation with a response. Callers then handle transport failures and error responses alike, as responses whose ok is false.

    It is the converse of reject, which turns unsuccessful responses into rejections.

    Usage

    import { createFetch } from "@grafctory/http";
    import { resolve } from "@grafctory/http/resolve";

    const client = createFetch(resolve()); // resolves with a response, whatever went wrong

    const response = await client("https://api.example.com/data");

    if ( !response.ok ) { // response.url names the resource that failed
    }
    resolve

    Creates a middleware answering failed exchanges with responses.