Installation
npx sse-hooks add use-map
yarn dlx sse-hooks add use-map
pnpm dlx sse-hooks add use-map
deno run -A npm:sse-hooks add use-map
bunx sse-hooks add use-map
Usage
example.ts
import { useMap } from "./{hooks file}";
const [map, mapActions] = useMap();
// Access the `map` state and use `mapActions` to set, remove, or reset entries.
API
Parameters
| Prop | Default | Type |
|---|---|---|
initialState |
|
The initial state of the map as a Map or an array of key-value pairs (optional). |
Returns
| Return Value | Default | Type |
|---|---|---|
return | - |
Hook return value |
Types Aliases
No specific type aliases defined for this component.