AbortSignal
The object from an AbortController that tells work it has been cancelled, through its aborted flag, its reason and an abort event.
In more detail
Pass it as the signal option to fetch or addEventListener and they clean up automatically when it fires. Your own code can check signal.aborted or call throwIfAborted().
Related terms
- AbortController — The standard JavaScript object for cancelling asynchronous work: its signal is handed to the work, and calling abort() cancels it.
- throwIfAborted() — An AbortSignal method that throws the signal's abort reason if it has been aborted, and does nothing otherwise.
- AbortSignal.timeout() — A function that returns a signal which aborts itself after a given number of milliseconds, with a TimeoutError.
- AbortSignal.any() — A function that combines several signals into one that aborts as soon as any of them does.
Taught in
- Cancellation With AbortController And Async Signal Propagation — Frontend Architecture & Web Platform
- useEffect Lifecycle: Mount, Dependencies, And Cleanup Phases — React 19 & Modern Component Architecture