MCPcopy Create free account
hub / github.com/Effect-TS/effect / mutateScoped

Function mutateScoped

packages/effect/src/Graph.ts:661–672  ·  view source on GitHub ↗
(
  mutable: MutableGraph<N, E, T>,
  f: (mutable: MutableGraph<N, E, T>) => undefined
)

Source from the content-addressed store, hash-verified

659
660/** @internal */
661const mutateScoped = <N, E, T extends Kind>(
662 mutable: MutableGraph<N, E, T>,
663 f: (mutable: MutableGraph<N, E, T>) => undefined
664): Graph<N, E, T> => {
665 let graph: Graph<N, E, T>
666 try {
667 f(mutable)
668 } finally {
669 graph = endMutation(mutable)
670 }
671 return graph
672}
673
674/**
675 * Performs scoped mutations on a graph, automatically managing the mutation lifecycle.

Callers 2

makeFunction · 0.85
Graph.tsFile · 0.85

Calls 2

endMutationFunction · 0.70
fFunction · 0.50

Tested by

no test coverage detected