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