

Custom hook that returns a debounced version of the provided value, along with a function to update it.

## Usage [#usage]

```tsx
import { useDebounceValue } from "@tilt-legal/cubitt-components/utilities/hooks";

const [debouncedValue, updateDebouncedValue] = useDebounceValue(inputValue, 500, { leading: true });
```

## API [#api]

### Signature [#signature]

```ts
declare function useDebounceValue<T>(initialValue: T | (() => T), delay: number, options?: UseDebounceValueOptions<T>): [T, DebouncedState<(value: T) => void>];
```

### Parameters [#parameters]

| Parameter      | Type     | Description                                                               | Default                    |   |
| -------------- | -------- | ------------------------------------------------------------------------- | -------------------------- | - |
| `initialValue` | \`T      | (() => T)\`                                                               | The value to be debounced. | - |
| `delay`        | `number` | The delay in milliseconds before the value is updated (default is 500ms). | -                          |   |
| `[options]`    | `object` | Optional configurations for the debouncing behavior.                      | -                          |   |

### Return Value [#return-value]

| Value    | Type                                               | Description                                                            |
| -------- | -------------------------------------------------- | ---------------------------------------------------------------------- |
| `return` | `[T, DebouncedState&lt;(value: T) =&gt; void&gt;]` | An array containing the debounced value and the function to update it. |
