useThrottleEffect
Throttle your useEffect.
Overview
Throttle your useEffect.
Installation
Open inpnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useThrottleEffect.jsonnpx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useThrottleEffect.jsonyarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useThrottleEffect.jsonbun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useThrottleEffect.jsonThrottle your useEffect.
Examples
Default usage
API
useThrottleEffect(
effect: EffectCallback,
deps?: DependencyList,
options?: Options
);Params
| Property | Description | Type | Default |
| -- | | -- | ---- |
| wait | The number of milliseconds to wait. | number | 1000 |
| leading | Specify invoking on the leading edge of the timeout. | boolean | true |
| trailing | Specify invoking on the trailing edge of the timeout. | boolean | true |