rez-table-listing-mui
Version:
A rez table listing component built on TanStack Table
16 lines (13 loc) • 347 B
text/typescript
export const customDebounce = <T extends (...args: any[]) => any>(
func: T,
delay: number
) => {
let timerId: NodeJS.Timeout;
return function (this: any, ...args: Parameters<T>) {
const context = this;
clearTimeout(timerId);
timerId = setTimeout(() => {
func.apply(context, args);
}, delay);
};
};