etc-hooks
Version:
Etcetera React 业务 Hooks
9 lines (8 loc) • 380 B
TypeScript
import type { ThrottleOptions } from '../useThrottle/throttleOptions';
type noop = (...args: any[]) => any;
declare function useThrottleFn<T extends noop>(fn: T, options?: ThrottleOptions): {
run: import("lodash-es").DebouncedFunc<(...args: Parameters<T>) => ReturnType<T>>;
cancel: () => void;
flush: () => ReturnType<T> | undefined;
};
export default useThrottleFn;