const debounced = ( delay , fn ) => { let timerId ; return ( ... args ) => { if ( timerId ) { clearTimeout ( timerId ) ; } timerId = setTimeout ( ( ) => { fn ( ... args ) ; timerId = null ; } , delay ) ; } ; } ; export default debounced ;