Skip to main content

AbortController

import { abortAfter, abortPromise, createAbortController } from '@rtorcato/js-common/abortController'

Exports

NameSummary
abortAfterAborts the given controller after a timeout (ms).
abortPromiseReturns a promise that rejects when the given AbortSignal is aborted.
createAbortControllerCreates a new AbortController and returns its controller and signal.
withAbortWraps a promise and rejects it if the signal is aborted.