Proposal: Add `AbortSignal.timeout()` shorthand to "Fetch: Abort" article

Open Beginner friendly
#3,988 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
javascript
Domain
documentation

Research direction

Open 5-network/04-fetch-abort/article.md and read the manual timeout example, especially the try..catch block. Add the proposed AbortSignal.timeout() subsection immediately after it, showing the shorthand and explaining the TimeoutError versus AbortError distinction. Done means the article clearly covers both timeout approaches.

Written by the indexing model from the issue text.

Description

Description

The "Fetch: Abort" article excellently explains the mechanics of AbortController and demonstrates a manual timeout using

setTimeout(() => controller.abort(), 1000)

Since aborting fetches due to time constraints is a very common use case, it would be highly beneficial for learners to also see the modern AbortSignal.timeout() method.

Proposal

I propose adding a short subsection titled ### AbortSignal.timeout() immediately following the try..catch block of the manual timeout example. This section will demonstrate the shorthand syntax and note the important distinction that it throws a TimeoutError rather than an AbortError.

Dominant language
HTML
Stars
25.5k
Forks
4k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from javascript-tutorial/en.javascript.info

All issues in javascript-tutorial/en.javascript.info

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.