@gyakusetsu/simple-debounce
v1.0.1
Published
Simple delayed function call from repeated function calls (e.g. user search textbox).
Downloads
6
Readme
debounce
Used for implementing behavior that should only happen after a repeated action from user with a delay.
Installation
$ npm i @gyakusetsu/simple-debounce
Example
var debounce = require('simple-debounce');
// Delays search query call/command for 250 ms after only user finished typing.
function debouncedSearch = debounce((query) => {
getItemsByName(query);
}, 250)
function handleSearchBoxChange(query) {
debouncedSearch();
}
License
MIT