本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2810

debounce-throttle

できること

このスキルは、スクロール、リサイズ、入力などの素早い操作に反応するWebサイトのコードをレビューします。より滑らかなページを求める開発者向けです。

使う場面

  • ✓誰かが入力している間に、検索ボックスが多すぎるリクエストを送るとき。
  • ✓ページのスクロールやリサイズがもたついて感じられるとき。
  • ✓スクリプトが必要以上に頻繁に実行されているとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/debounce-throttle/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/debounce-throttle/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のスクロールと入力の処理にもたつきがないか、確認してもらえますか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは素早いイベントで実行されるコードを見つけ、debounceまたはthrottleを提案します。debounceは操作が止まるまで待ち、throttleはコードの実行頻度を制限します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Debounce and throttle event handlers

High-frequency events fire hundreds of times per second, causing UI jank, excessive API calls, and poor Interaction to Next Paint (INP) scores.

Quick Reference

  • Debounce: delays execution until activity stops (search inputs, form validation)
  • Throttle: limits execution rate (scroll, resize handlers)
  • Use 150-300ms delay for user input, 100ms for scroll/resize
  • Clean up event listeners to prevent memory leaks

Check

Review this JavaScript code for scroll, resize, input, mousemove, or other high-frequency event handlers that should use debounce or throttle.

Fix

Add debounce or throttle to high-frequency event handlers to limit execution rate and improve performance.

Explain

Explain the difference between debounce and throttle, and when to use each pattern for optimal performance.

Code Review

Review scripts, client components, and browser execution paths related to Debounce and throttle event handlers. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/javascript/debounce-throttle

よくある質問

debounceとthrottleの違いは何ですか?

debounceは利用者が止まるまで待ちます。throttleは操作が続く間も、一定の制限された頻度でコードを実行します。

どのくらいの遅延を提案していますか?

入力には約150から300ミリ秒、スクロールとリサイズには約100ミリ秒を提案しています。

イベントのリスナーは、なぜ片付けるべきですか?

リスナーを片付けると、時間とともにページを遅くするメモリリークを防げると、このスキルは説明しています。

詳細

作者による元の説明

Use when reviewing scripts, client components, bundles, or runtime behavior related to Debounce and throttle event handlers. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2810
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル