← All Tools

AbortSignal Playground

Cancellation in modern JavaScript is one signal — AbortSignal — wired through fetch, addEventListener, streams, and timers. Pick a strategy (timeout, manual abort, race), wire up signals, and either run a live fetch() against a public endpoint or simulate a slow async task. The generated code uses AbortSignal.timeout() and AbortSignal.any() when they apply.

Used when running the simulated task.
Try https://httpbin.org/delay/3 (3s) or https://httpbin.org/delay/1 (1s) to see timeouts succeed vs fail.
All listed signals are combined with AbortSignal.any(). Whichever fires first wins, and reason tells you which.
Run log
Support: AbortController: all modern browsers + Node 15+. AbortSignal.timeout(): Chrome 103+, Safari 15.4+, Firefox 100+. AbortSignal.any(): Chrome 116+, Safari 17.4+, Firefox 124+ (early 2024).
Generated code

    

Cheat sheet