Skip to content

useSet ​

Category
Utilities

Hook that manages a set structure

typescript
import { useSet } from '@siberiacancode/reactuse';

Usage ​

typescript
const { value, add, remove, clear, reset, toggle, union, intersection, difference, symmetricDifference, size, has } = useSet([1, 2, 3]);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
values?Value[]-The initial array of the set

Contributors ​

Source • Demo