github / github/mini-throttle

Add support for `trailing:false`

オープン
#36 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
229
フォーク
18
平均マージ
1日 10時間
マージ済み PR(30日)
2

説明

The current default behavior is for two quick calls to result in two slow calls: one leading call and one trailing call. This is often not desirable - the point of throttling is to _reduce_ the number of calls, not just to slow them down. For this we would need a `trailing` option to control trailing edge calls:

```
| fn() | 1 2 3 4 |
| throttle(fn, 100) | 1 3 4 |
| throttle(fn, 100, {trailing: false}) | 1 3 |
```

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

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

調査の方向性

Start by reading the throttle implementation and its existing options, then inspect the current tests for leading and trailing calls. Add coverage for the trailing:false behavior shown in the issue and verify that trailing calls are suppressed while the leading calls still occur as illustrated.

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

評価

技術スタック
typescript
領域
tooling
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
58/100

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

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