useThrottle
Utility
A React hook that throttles a value, limiting how often it can update to at most once per specified interval for performance optimization.
Installation
npm install @thibault.sh/hooksAPI Reference
Signature
function useThrottle<T>(value: T, interval: number): TParameters
| Name | Type | Description | Default |
|---|---|---|---|
value | T | The value to throttle. | - |
interval | number | The minimum time interval between updates in milliseconds. | - |
Returns
T
The throttled value that updates at most once per interval.