Skip to content

useTimeout ​

Category
Time

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

Contributors ​

Source • Demo