javascript-tutorial / javascript-tutorial/en.javascript.info
Proposal: Add `AbortSignal.timeout()` shorthand to "Fetch: Abort" article
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 25.5k
- Forks
- 4k
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100