Installation
npx sse-hooks add use-timeout
yarn dlx sse-hooks add use-timeout
pnpm dlx sse-hooks add use-timeout
deno run -A npm:sse-hooks add use-timeout
bunx sse-hooks add use-timeout
Usage
example.ts
import { useTimeout } from "./{hooks file}";
// Usage of useTimeout hook
useTimeout(() => {
// Code to be executed after the specified delay
}, 1000); // Set a timeout of 1000 milliseconds (1 second)
API
Parameters
| Prop | Default | Type |
|---|---|---|
callback | - |
The function to be executed when the timeout elapses. |
delay | - |
The duration (in milliseconds) for the timeout. Set to |
Returns
| Return Value | Default | Type |
|---|---|---|
return | - |
Hook return value |
Types Aliases
No specific type aliases defined for this component.