export class Callbacks { public static debounce < F extends ( ... args : any [ ] ) => any > ( func , wait = 300 ) { let timeoutID ; return function ( this , ... args ) { clearTimeout ( timeoutID ) ; const context = this ; timeoutID = window . setTimeout ( ( ) => { func . apply ( context , args ) ; } , wait ) ; } as any ; } }