UNPKG

common-utils-y

Version:

my common utils lib

15 lines (14 loc) 392 B
/** * 防抖函数 * @param fn 回调函数 * @param delay 防抖时间默认10ms * @returns 防抖执行的函数,返回取消钩子 * * @example * * const debounceFun = debounce(callback, 30); * const cancel = debounceFun(); * // 取消执行 * cancel(); */ export declare function debounce(fn: (...args: unknown[]) => unknown, delay?: number): (...arg: any[]) => () => void;