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