Skip to content

useThrottleState ​

Hook that creates a throttled state

utilities
medium
test coverage
Last changed: 12 days ago

Installation ​

Library
CLI
Manual
typescript
import { useThrottleState } from '@siberiacancode/reactuse';

Usage ​

typescript
const [throttledValue, setThrottledValue] = useThrottleState(value, 500);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
valueValue-The value to be throttled
delaynumber-The delay in milliseconds

Returns

[Value, (value: Value) => void]

Source ​

Source • Demo

Contributors ​

D
debabin
debabin

Released under the MIT License.