debounce-on
debounce a function based on its arguments
Install
$ npm install debounce-on
Use
For instance, you might want to rate-limit a client on a per-endpoint basis:
var debounceOn = ; var debounceHttp = ;;;; // ... wait 100ms // one request is sent to:// - google.com// - yahoo.com
You can pass a hash function that determines what calls the debouncer should coalesce:
var debounceOn = ; var debounceHttp = ;;;; // ... wait 100ms // one request is sent to:// - google.com/a// - yahoo.com
API
ver debouncedFn = ;
fn
The function to debounce.
timeout
The timeout in ms
.
hashFn
Function that determines what calls the debouncer should coalesce.
License
MIT