useDebounce
防抖hooks,lodash debounce包裹hooks
安装
npm
pnpm
yarn
npm install @jelper/hooks
引入
import { useDebounce } from '@jelper/hooks';
样例
基础用法
count: 0
基础用法
API
参数 | 说明 | 类型 | 默认值 | 版本 |
---|---|---|---|---|
useDebounce | 基于 lodash debounce封装 | UseDebounce | -- |
Interface
import { debounce, DebounceSettings, DebouncedFunc } from 'lodash-es';
const useDebounce<T extends (...args: any) => any> = (
cb: T,
wait?: number,
opts?: DebounceSettings
): DebouncedFunc<T>