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

Function endMutation

packages/effect/src/Graph.ts:755–768  ·  view source on GitHub ↗
(
  mutable: MutableGraph<N, E, T>
)

Source from the content-addressed store, hash-verified

753 * @since 3.18.0
754 */
755export const endMutation = <N, E, T extends Kind = "directed">(
756 mutable: MutableGraph<N, E, T>
757): Graph<N, E, T> => {
758 assertMutable(mutable)
759 if (internal.isTransforming(mutable)) {
760 throw new GraphError({ message: "Cannot mutate graph during a transformation" })
761 }
762 const source = internal.toImpl(mutable)
763 csr.invalidate(mutable)
764 const graph = internal.finalize(source)
765 source.mutable = false
766
767 return graph as unknown as Graph<N, E, T>
768}
769
770/** @internal */
771const mutateScoped = <N, E, T extends Kind>(

Callers 1

mutateScopedFunction · 0.70

Calls 3

assertMutableFunction · 0.85
invalidateMethod · 0.65
finalizeMethod · 0.45

Tested by

no test coverage detected