useTimeout
jsxhook
useTimeout: run a callback once after a delay
Terminal
$termuijs render use-timeout
Installation
$ bunx termuijs add use-timeout
Copies the source into src/components/use-timeout/ and installs @termuijs/jsx.
Usage
ts
import { useTimeout } from '@termuijs/jsx'ts
const { value, set, reset } = useTimeout({
initial: undefined,
})API Reference
useTimeout
| Prop | Type | Default | Description |
|---|---|---|---|
initial | T | undefined | — | Initial value |
persist | boolean | false | Persist to storage |
key | string | — | Storage key |