@rooks/use-throttle
Version:
A throttle hook for react
11 lines (9 loc) • 337 B
TypeScript
/**
* useThrottle
* Throttles a function with a timeout and ensures
* that the callback function runs at most once in that duration
* @param fn The callback to throttle
* @param timeout Throttle timeout
*/
declare function useThrottle(fn: Function, timeout?: number): [(...args: any) => any, boolean];
export default useThrottle;