@debounce is named improperly — should be @throttle
- 主要语言
- 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 还没有评估数据。