MCPcopy Create free account
hub / github.com/effect-app/libs / toggle_

Function toggle_

packages/effect-app/src/Set.ts:497–502  ·  view source on GitHub ↗
(E: Equivalence.Equivalence<A>)

Source from the content-addressed store, hash-verified

495 * If element is present remove it, if not add it
496 */
497export function toggle_<A>(E: Equivalence.Equivalence<A>): (set: Set<A>, a: A) => Set<A> {
498 const elemE = elem_(E)
499 const removeE = remove(E)
500 const insertE = insert(E)
501 return (set, a) => (elemE(set, a) ? removeE : insertE)(a)(set)
502}
503
504/**
505 * Create a set from an array

Callers 1

toggleFunction · 0.85

Calls 3

elem_Function · 0.85
removeFunction · 0.70
insertFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…