useTimeout ​
Hook that executes a callback function after a specified delay
typescript
import { useTimeout } from '@elysiumorg/solid-use';
Usage ​
typescript
const timeout = useTimeout(() = > {}, 5000);
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
callback | () => void | - | The function to be executed after the timeout |
delay | number | - | The delay in milliseconds before the timeout executes the callback function |