export default function useDebounce ( fn , wait = 100 ) { let timeout ; return ( ... args ) => { clearTimeout ( timeout ) ; timeout = < any > setTimeout ( ( ) => { fn ( ... args ) ; } , wait ) ; } ; }