developit / developit/decko

@debounce is named improperly — should be @throttle

オープン
#9 コメント 4 件 リアクション 10 件 担当者 0 名 GitHub で見る
bug discussion help wanted
主要言語
JavaScript
スター
1k
フォーク
34
PR マージ指標
30日以内にマージされた PR はありません

説明

In the [docs](https://github.com/developit/decko#debounce) its says:
> To debounce means "call this at most once per N ms". All outward function calls get collated into a single inward call, and only the latest (most recent) arguments as passed on to the debounced function.

What you're doing is throttling, not debouncing.
[lodash.throttle](https://lodash.com/docs/4.17.4#throttle):
> Creates a throttled function that only invokes `func` at most once per every `wait` milliseconds.

[lodash.debounce](https://lodash.com/docs/4.17.4#debounce):
> Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked.

And while on the topic, a (real) `@debounce` would be a great addition.

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

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

評価

この issue はまだ評価されていません。

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

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