Package Exports
- debounce-fn
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (debounce-fn) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
debounce-fn 
Debounce a function
Install
$ npm install debounce-fnUsage
const debounceFn = require('debounce-fn');
window.onresize = debounceFn(() => {
// Do something on window resize
}, {wait: 100});API
debounceFn(input, [options])
Returns a debounced function that delays calling the input function until after wait milliseconds have elapsed since the last time the debounced function was called.
It comes with a .cancel() method to cancel any scheduled input function calls.
input
Type: Function
Function to debounce.
options
Type: Object
wait
Type: number
Default: 0
Time to wait until the input function is called.
immediate
Type: boolean
Default: false
Trigger the function on the leading edge instead of the trailing edge of the wait interval. For example, can be useful for preventing accidental double-clicks on a "submit" button from firing a second time.
Related
- p-debounce - Debounce promise-returning & async functions
License
MIT © Sindre Sorhus