UNPKG

@ehsaneha/react-throttle

Version:

useThrottle is a custom React hook that limits how often a function can be called by ensuring it's invoked at most once within a specified delay period.

7 lines (6 loc) 227 B
/** * useThrottle * @param callback - Function to be throttled * @param delay - Time interval in milliseconds */ export declare function useThrottle<T extends (...args: any[]) => void>(callback: T, delay: number): T;