kinetex - v1.0.0-rc.1
    Preparing search index...

    Function createAbortHook

    • Hook: abort request if signal fires before it completes.

      The abort error uses DOMException when available (browsers, Deno, Bun, Node.js 18+). Falls back to a plain Error in older runtimes. The AbortError name is set on the fallback error for compatibility.

      Parameters

      • this: void

      Returns { beforeRequest: BeforeRequestHook; onCancel: OnCancelHook }

      An object containing:

      • beforeRequest: Checks the request signal — throws AbortError if already aborted.
      • onCancel: Logs cancellation with the request URL and reason.
      • beforeRequest: BeforeRequestHook

        Checks the request signal — throws AbortError if already aborted.

      • onCancel: OnCancelHook

        Logs cancellation with the request URL and reason.