useSet
API
import useSet from '@restart/hooks/useSet'
useSet
<V>(init?: Iterable<V>) => ObservableSet<V>Create and return a Set that triggers rerenders when it's updated.
const ids = useSet<number>([1,2,3,4]);return (<>{Array.from(ids, id => (<div>id: {id}. <button onClick={() => ids.delete(id)}>X</button></div>)}</>)Parameters
init?
Iterable<V>initial Set values
Return Value ObservableSet<V>