MCPcopy Index your code
hub / github.com/Effect-TS/effect / diff

Function diff

packages/effect/src/internal/supervisor/patch.ts:156–182  ·  view source on GitHub ↗
(
  oldValue: Supervisor.Supervisor<any>,
  newValue: Supervisor.Supervisor<any>
)

Source from the content-addressed store, hash-verified

154
155/** @internal */
156export const diff = (
157 oldValue: Supervisor.Supervisor<any>,
158 newValue: Supervisor.Supervisor<any>
159): SupervisorPatch => {
160 if (Equal.equals(oldValue, newValue)) {
161 return empty
162 }
163 const oldSupervisors = toSet(oldValue)
164 const newSupervisors = toSet(newValue)
165 const added = pipe(
166 newSupervisors,
167 HashSet.difference(oldSupervisors),
168 HashSet.reduce(
169 empty as SupervisorPatch,
170 (patch, supervisor) => combine(patch, { _tag: OP_ADD_SUPERVISOR, supervisor })
171 )
172 )
173 const removed = pipe(
174 oldSupervisors,
175 HashSet.difference(newSupervisors),
176 HashSet.reduce(
177 empty as SupervisorPatch,
178 (patch, supervisor) => combine(patch, { _tag: OP_REMOVE_SUPERVISOR, supervisor })
179 )
180 )
181 return combine(added, removed)
182}
183
184/** @internal */
185export const differ = Differ.make<Supervisor.Supervisor<any>, SupervisorPatch>({

Callers

nothing calls this directly

Calls 3

toSetFunction · 0.70
combineFunction · 0.70
pipeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…