

Custom hook that manages a key-value [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) state with setter actions.

## Usage [#usage]

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

const [map, mapActions] = useMap();
// Access the `map` state and use `mapActions` to set, remove, or reset entries.
```

## API [#api]

### Signature [#signature]

```ts
declare function useMap<K, V>(initialState?: MapOrEntries<K, V>): UseMapReturn<K, V>;
```

### Parameters [#parameters]

| Parameter        | Type                       | Description                                                                      | Default |
| ---------------- | -------------------------- | -------------------------------------------------------------------------------- | ------- |
| `[initialState]` | `MapOrEntries&lt;K, V&gt;` | The initial state of the map as a Map or an array of key-value pairs (optional). | -       |

### Return Value [#return-value]

| Value    | Type                       | Description                                                            |
| -------- | -------------------------- | ---------------------------------------------------------------------- |
| `return` | `UseMapReturn&lt;K, V&gt;` | A tuple containing the map state and actions to interact with the map. |
