debouncie
v0.0.3
Published
Debounce that returns a promise.
Downloads
2
Maintainers
Readme
Debounce function which returns a promise. Lower memory footprint than alternative solutions
Node Install:
$ npm install --save debouncie
Deno Install:
coming soon
Example
import debouncie from 'debouncie';
function someAsyncFunction(a, b, c) {
return Promise.resolve();
}
const debounced = debouncie(someAsyncFunction, { debounce: 500 });
debounced('a', 'b', 'c')
.then(() => {
// Do something else. This doesn't normally return a promise in, for example, lodash debounce.
});