effect-io-ai

Package: effect
Module: Graph

Graph.endMutation

Converts a mutable graph back to an immutable graph, ending the mutation scope.

Example

import { Graph } from "effect"

const graph = Graph.directed<string, number>()
const mutable = Graph.beginMutation(graph)
// ... perform mutations on mutable ...
const newGraph = Graph.endMutation(mutable)

Signature

declare const endMutation: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>) => Graph<N, E, T>

Source

Since v3.18.0