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