

Use `useResettableTimeout` to schedule a single timeout that resets on repeated starts.

## Usage [#usage]

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

const { start, clear } = useResettableTimeout(() => {
  setOpen(false);
}, 300);

start(); // schedules callback in 300ms
start(500); // resets and schedules for 500ms
clear(); // cancels pending callback
```

## API [#api]

### Parameters [#parameters]

| Option     | Type            | Description                            | Default |
| ---------- | --------------- | -------------------------------------- | ------- |
| `callback` | `() =&gt; void` | Function called when the timeout fires | -       |
| `delay`    | `number`        | Timeout duration in milliseconds       | -       |

### Return Value [#return-value]

| Value   | Type                                  | Description                                    |
| ------- | ------------------------------------- | ---------------------------------------------- |
| `start` | `(delayOverride?: number) =&gt; void` | Starts the timeout and resets any active timer |
| `clear` | `() =&gt; void`                       | Cancels the currently scheduled timeout        |

### Behavior [#behavior]

* `start` always clears any pending timer before creating a new one.
* The latest callback reference is used when the timeout fires.
* Pending timers are cleaned up on unmount.
