SSE Hooks

useMap

Custom hook that manages a key-value [Map](https://developer.

Installation

npx sse-tool add use-map

Usage

import { useMap } from "./{hooks file}";

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

API

Parameters

NameTypeDescription
initialStateMapOrEntriesThe initial state of the map as a Map or an array of key-value pairs (optional).

Return Value

Returns UseMapReturn.

A tuple containing the map state and actions to interact with the map.

Changelog

c165d — feat: enhance useRoleGuard and useSSR hooks with additional options and documentation

30da4 — feat: add new hooks and their metadata

cf13e — feat: add custom hooks for step navigation, ternary dark mode, timeout, toggle, unmount, and window size

Built with Love • © 2026