javascript-tutorial / javascript-tutorial/en.javascript.info

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

オープン 初心者向け
#3,988 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
HTML
スター
25.5k
フォーク
4k
PR マージ指標
30日以内にマージされた PR はありません

説明

### Description

The ["Fetch: Abort"](https://github.com/javascript-tutorial/en.javascript.info/blob/20208769e528337949e946f526534d61d38bac47/5-network/04-fetch-abort/article.md) article excellently explains the mechanics of `AbortController` and demonstrates a manual timeout using

```js
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()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static) 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`.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

5-network/04-fetch-abort/article.md を開き、手動タイムアウトの例、特に try..catch ブロックを読んでください。その直後に、AbortSignal.timeout() に関する提案されたサブセクションを追加し、省略形を示して TimeoutError と AbortError の違いを説明してください。記事で両方のタイムアウト方法が明確に扱われていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
documentation
issue の種類
ドキュメント
難易度
1/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
88/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。