Utility functions to use and combine `AbortSignal` and `AbortController` with Promises
MIT License
Utility functions to use and combine
AbortSignal
andAbortController
with Promises
npm install abort-utils
import {
onAbort,
mergeSignals,
linkControllers,
promiseFromSignal,
ReusableAbortController
} from 'abort-utils';
This package exports various utilities, just import what you need.
AbortSignal
that is aborted when an event is dispatched.AbortSignal
that is aborted when a Promise is resolved or rejected.AbortController
, but it generates a new signal after it's aborted.Here's a visual representation that might help understand how some of the methods differ and behave.
MIT © Federico Brigante