synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
31 lines (30 loc) • 513 B
JavaScript
import { useState as d, useCallback as s } from "react";
function f(c) {
const [e, n] = d(new Set(c)), S = s(
(...o) => {
const t = new Set(e);
for (const w of o)
t.add(w);
n(t);
},
[e]
), r = s(
(o) => {
const t = new Set(e);
t.delete(o), n(t);
},
[e]
), a = s(() => {
n(/* @__PURE__ */ new Set());
}, []);
return {
set: e,
add: S,
remove: r,
clear: a
};
}
export {
f as useSet
};
//# sourceMappingURL=useSet.js.map