useMap
A hook that can manage the state of Map.
Overview
A hook that can manage the state of Map.
Installation
Open inpnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useMap.jsonnpx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useMap.jsonyarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useMap.jsonbun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useMap.jsonA hook that can manage the state of Map.
Examples
Default usage
API
const [
map,
{
set,
setAll,
remove,
reset,
get
}
] = useMap<K, V>(initialValue);Result
| Property | Description | Type |
| -- | | | - |
| initialValue | Optional, set default value | Iterable<[K, V]> | - |