import { debounce } from '../../utils/debounce/debounce.util' ; /**
 * Debounce decorator
 *
 *  class MyClass {
 *    debounceable(10)
 *    myFn() { ... }
 *  }
 */ export function debounceable ( duration , immediate ? ) { return ( _ , key , descriptor ) : any => { return { configurable : true , enumerable : descriptor . enumerable , get : function getter ( ) { Object . defineProperty ( this , key , { configurable : true , enumerable : descriptor . enumerable , value : debounce ( descriptor . value , duration , immediate ) } ) ; return this [ key ] ; } } ; } ; }