@td-design/rn-hooks
Version:
从ahooks里面抽取的一些在rn项目里可以使用的hooks。提高开发效率
14 lines (13 loc) • 488 B
TypeScript
import type { ThrottleOptions } from '../useThrottle/ThrottleOptions';
type noop = (...args: any) => any;
/**
* 用来处理节流函数的 Hook。
* @param fn 需要节流的函数
* @param options 配置节流的行为
*/
export default 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 {};