license import { debounce as lodashDebounce } from "lodash" ; export default function debounce ( timeout ) { return < T > ( target , propertyKey , descriptor ) : TypedPropertyDescriptor < ( ) => T > => { const originalMethod = descriptor . value ; if ( originalMethod === undefined ) { throw new Error ( "No function to debounce." ) ; } descriptor . value = lodashDebounce ( originalMethod , timeout ) ; return descriptor ; } ; }