packageDocumentation module import * as React from "react" ; import { throttle } from "lodash" ; internal export interface ThrottleSettings { leading : boolean ; trailing : boolean ; } const defaultOptions = { leading : false , trailing : true } ; internal export function useThrottledFn < T extends ( ... args : any ) => any > ( functionToThrottle , waitTime , dependencies , options = defaultOptions ) { const throttledFunction = throttle ( functionToThrottle , waitTime , options ) ; return React . useCallback ( throttledFunction , dependencies ) ; }