export function debounce( func: F, wait: number = 200 ): F { let timeoutID: number; return function( this: any, ...args: any[] ) { clearTimeout(timeoutID); const context = this; timeoutID = window.setTimeout( () => func.apply( context, args ), wait ); }; };