Skip to content

useTimeout ​

time
test coverage
Last changed: last month

Hook that executes a callback function after a specified delay

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

Usage ​

typescript
const { clear, ready } = useTimeout(() => {}, 5000);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
callback() => void-The function to be executed after the timeout
delaynumber-The delay in milliseconds before the timeout executes the callback function

Source ​

Source • Demo

Contributors ​

Avatardebabin
Avatarhywax
Avatartriangle

Released under the MIT License.