Package: effect
Module: Graph
Returns an iterator over the indices in the walker.
Example
import { Graph } from "effect"
const graph = Graph.directed<string, number>((mutable) => {
const a = Graph.addNode(mutable, "A")
const b = Graph.addNode(mutable, "B")
Graph.addEdge(mutable, a, b, 1)
})
const dfs = Graph.dfs(graph, { start: [0] })
const indices = Array.from(Graph.indices(dfs))
console.log(indices) // [0, 1]
Signature
declare const indices: <T, N>(walker: Walker<T, N>) => Iterable<T>
Since v3.18.0