debounce-queue
Debounce that gives you an array of all previous events instead of just the last one.
Install
npm install debounce-queue --save
Usage
Example
import { watch } from 'fs'
import debounce from 'debounce-queue'
watch('.', debounce(list => {
for(const [eventType, filename] of list) {
...
}
}))
API
debounce(func, opts)
func
<function>(required)
The function to debounceopts
[number|object]
Options or waitopts.wait
[number=0]
The number of milliseconds to delayopts.leading
[boolean=false]
Specify invoking on the leading edge of the timeout.opts.maxWait
[number]
The maximum time func is allowed to be delayed before it's invoked.opts.trailing
[boolean=true]
Specify invoking on the trailing edge of the timeout.