import { useCallback , useEffect , DependencyList } from 'react' ; type EffectFunction = ( ... args : any [ ] ) => any ; export const useDebouncedEffect = ( effect , delay , deps ) => { const callback = useCallback ( effect , deps ) ; useEffect ( ( ) => { const timeout = setTimeout ( ( ) => { callback ( ) ; } , delay ) ; return ( ) => { clearTimeout ( timeout ) ; } ; } , [ callback , delay ] ) ; } ;