Skip to content

useThrottleCallback ​

utilities
test coverage
Last changed: 28 days ago

Hook that creates a throttled callback

typescript
import { useThrottleCallback } from '@siberiacancode/reactuse';

Usage ​

typescript
const throttled = useThrottleCallback(() => console.log('callback'), 500);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
callback(...args: Params) => Return-The callback function
delaynumber-The delay in milliseconds

Source ​

Source • Demo

Contributors ​

Avatardebabin
Avatarhywax

Released under the MIT License.