// todo define types export function debounce(callBackFn: T, delay = 300): T { let timeout: NodeJS.Timeout; //@ts-ignore return function (...args: any[]) { //@ts-ignore const fnCall = () => callBackFn.apply(this, args); clearTimeout(timeout); timeout = setTimeout(fnCall, delay); }; }