---
source: https://iinventedlight.com/library/notes/javascript-abort-signal.md
title: "AbortSignal: cancel fetch and other ongoing work"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (Chrome Developers); CC-BY-4.0 (WHATWG); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Chrome Developers, Abortable fetch; WHATWG, DOM Living Standard, Aborting ongoing activities. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC. CC-BY-4.0 (https://raw.githubusercontent.com/whatwg/fetch/main/LICENSE). Copyright WHATWG contributors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: javascript-abort-signal"
tags: [javascript, fetch, abortcontroller, abortsignal, web]
client: Librarian
sources:
  - id: S1
    title: "Abortable fetch"
    publisher: Chrome Developers
    url: https://developer.chrome.com/blog/abortable-fetch
    accessed: 2026-11-23
    license: "CC-BY-4.0"
  - id: S2
    title: "DOM Living Standard, Aborting ongoing activities"
    publisher: WHATWG
    url: https://dom.spec.whatwg.org/#aborting-ongoing-activities
    accessed: 2026-11-23
    license: "CC-BY-4.0"
---
# AbortSignal: cancel fetch and other ongoing work
**Answer:** AbortController provides an abort() method that toggles the state of a corresponding AbortSignal. Fetch can take an AbortSignal. If no abort reason is given, an AbortError DOMException is stored.

## The controller and signal

Meet the AbortController and AbortSignal. Read signal from the controller.

The controller only has one method: abort(). When you do this, it notifies the signal.

The DOM standard provides this API. It stays deliberately generic so other web standards and libraries can adopt it.

Fetch can take an AbortSignal.

One pattern is to abort() from a timer so a fetch times out after 5 seconds.

Calling abort() after a completed fetch is ok; fetch simply ignores it.

## What the DOM standard requires

Promises lack a built-in aborting mechanism, yet many APIs that use them still need abort semantics.

To cover that gap, AbortController supplies abort(), which toggles the state of a corresponding AbortSignal object.

An API can accept an AbortSignal object, and use its state to determine how to proceed.

new AbortController() yields a controller whose signal is a newly created AbortSignal object.

If reason is undefined, then an AbortError DOMException will be stored.

AbortSignal.any(signals) returns an instance which will be aborted once any of those signals is aborted.

## See also

- [javascript-fetch](https://iinventedlight.com/library/notes/javascript-fetch/)
- [javascript-promises](https://iinventedlight.com/library/notes/javascript-promises/)
- [javascript-async-await](https://iinventedlight.com/library/notes/javascript-async-await/)

## Claims

- id: C1
  claim: Fetch can take an AbortSignal.
  source: S1
  evidence: "Fetch can take an AbortSignal"

- id: C2
  claim: The controller only has one method, abort().
  source: S1
  evidence: "The controller only has one method"

- id: C3
  claim: abort() toggles the state of a corresponding AbortSignal.
  source: S2
  evidence: "toggles the state of a corresponding AbortSignal"

- id: C4
  claim: If reason is undefined, an AbortError DOMException is stored.
  source: S2
  evidence: "an \" AbortError \" DOMException will be stored"

- id: C5
  claim: AbortSignal.any() aborts when any of the given signals aborts.
  source: S2
  evidence: "aborted once any of signals is aborted"

## Sources

- [S1] Abortable fetch. Chrome Developers. https://developer.chrome.com/blog/abortable-fetch . License: CC-BY-4.0. Accessed 2026-11-23.

- [S2] DOM Living Standard, Aborting ongoing activities. WHATWG. https://dom.spec.whatwg.org/#aborting-ongoing-activities . License: CC-BY-4.0. Accessed 2026-11-23.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Chrome Developers, Abortable fetch; WHATWG, DOM Living Standard, Aborting ongoing activities. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC. CC-BY-4.0 (https://raw.githubusercontent.com/whatwg/fetch/main/LICENSE). Copyright WHATWG contributors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
