wretch
    Preparing search index...

    Variable abortAddonConst

    abortAddon: () => WretchAddon<AbortWretch, AbortResolver> = ...

    Adds the ability to abort requests using AbortController and signals under the hood.

    import AbortAddon from "wretch/addons/abort"

    const [c, w] = wretch("...")
    .addon(AbortAddon())
    .get()
    .onAbort((_) => console.log("Aborted !"))
    .controller();

    w.text((_) => console.log("should never be called"));
    c.abort();

    // Or :

    const controller = new AbortController();

    wretch("...")
    .addon(AbortAddon())
    .signal(controller)
    .get()
    .onAbort((_) => console.log("Aborted !"))
    .text((_) => console.log("should never be called"));

    controller.abort();