abort-helpers
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

abort-helpers

This includes a polyfill for AbortController, and also some utilities

AbortError

You can use AbortError like a generic error emitted from an AbortController. This should even work for DOMExceptions.

try {
	checkAbort(AbortSignal.abort());
} catch (e) {
	if (e instanceof AbortError) {
		// true
	}
}

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i abort-helpers

    Weekly Downloads

    2

    Version

    1.2.3

    License

    none

    Unpacked Size

    14.5 kB

    Total Files

    18

    Last publish

    Collaborators

    • mailmindlin