@debounce is named improperly — should be @throttle
- Lingua principale
- JavaScript
- Stelle
- 1k
- Fork
- 34
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Start with the debounce documentation section linked in the issue and compare the described behavior with the lodash throttle and debounce definitions. Update the naming to match the behavior and determine the scope of adding a real debounce decorator; done means the documentation and exposed decorator behavior use the correct terms.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100