@memsdb/core
Version:
A simple embedded document based database with advanced querying, advanced population/tree creation, and multiple storage and backup providers.
20 lines • 564 B
JavaScript
/**
* Debounce a function so it only runs the one time for function calls within
* a length of time of eachother
* @ignore
* @param callback Function to debounce
* @param waitFor Amount of time to wait for
* @returns The result of the function
*/
export const debounce = (callback, waitFor) => {
let timeout;
return (...args) => {
let result;
clearTimeout(timeout);
timeout = setTimeout(() => {
result = callback(...args);
}, waitFor);
return result;
};
};
//# sourceMappingURL=Debounce.js.map