export const debounce = any>( callback: T, waitFor: number ): any => { let timeout: any = 0; return (...args: Parameters): ReturnType => { let result: any; clearTimeout(timeout); timeout = setTimeout(() => { result = callback(...args); }, waitFor); return result; }; };