useThrottleState ​
Hook that creates a throttled state
utilities
medium
test coverage
Last changed: 2 months ago
Installation ​
Library
CLI
Manual
typescript
import { useThrottleState } from '@siberiacancode/reactuse';Usage ​
typescript
const [throttledValue, setThrottledValue] = useThrottleState(value, 500);Demo ​
Api ​
Parameters
| Name | Type | Default | Note |
|---|---|---|---|
| value | Value | - | The value to be throttled |
| delay | number | - | The delay in milliseconds |
Returns
[Value, (value: Value) => void]
Source ​
Source • DemoContributors ​
D