MCPcopy
hub / github.com/marimo-team/marimo / toggle

Function toggle

frontend/src/utils/sets.ts:34–42  ·  view source on GitHub ↗

* Return a new set with `item` toggled — removed if present, added if not.

(set: Set<T>, item: T)

Source from the content-addressed store, hash-verified

32 * Return a new set with `item` toggled — removed if present, added if not.
33 */
34 toggle<T>(set: Set<T>, item: T): Set<T> {
35 const result = new Set(set);
36 if (result.has(item)) {
37 result.delete(item);
38 } else {
39 result.add(item);
40 }
41 return result;
42 },
43};

Callers

nothing calls this directly

Calls 3

hasMethod · 0.45
deleteMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…