debounce-my-function
v1.0.6
Published
Debounce any function passed to execute after X milliseconds
Downloads
23
Maintainers
Readme
debounce-my-function
Description
Debounce My Function is a helper to transform any function passed in "debounced". Which means, the function passed will execute after X ms.
Installation
yarn add debounce-my-function
or
npm install debounce-my-function --save
Usage
import { debounceMyFunction } from "debounce-my-function";
const debouncedFunction = debounceMyFunction(yourFunction, 1000);
debouncedFunction();
// Your function will execute with a delay of 1000 ms.
Parameters
- First Parameter (required): Your function to be debounced
- Second Parameter (optional): time in ms for the delay