首页 > TAG信息列表 > useThrottle

React Hooks 手写节流useThrottle

定义 import { useCallback, useEffect, useRef } from "react" export interface ThrottleRefType { fn: Function, timer?: NodeJS.Timeout } export type ThrottlePropsType = [Function, number, Array<any>] const useThrottle = (...[fn, thr