useDebounceutilities
useDebounce
NewSSR SAFEDebounces a value or function for better performance.
$ pnpm dlx shadcn@latest add @byphongphan/use-debounceRequires
@byphongphan in components.jsonuse-debounce.tsx
Loading preview...
Installation
$ pnpm dlx shadcn@latest add @byphongphan/use-debounceRequires
@byphongphan in components.jsonUsage
Props & Parameters
| Param | Type | Default | Description |
|---|---|---|---|
value | T | — | The rapidly changing input value to debounce. |
delay | number | 500 | Delay in milliseconds before updating debounced value. |
Returns
| Return | Type | Description |
|---|---|---|
debouncedValue | T | The debounced value updated only after the delay timer expires without changes. |