@darwish/hooks-core
Version:
9 lines (8 loc) • 314 B
TypeScript
export type StableActions<T> = {
add: (addValue: T) => void;
has: (hasValue: T) => boolean;
remove: (removeValue: T) => void;
toggle: (toggleValue: T) => void;
reset: () => void;
};
export default function useSet<T>(initialValue: Array<T> | Set<T>): [state: Set<T>, actions: StableActions<T>];