GraphReFlyTS

API Reference

scanLog()

Standalone incremental scan over a reactive log. Equivalent to log.scan(initial, step); provided for pipe-builder and helper-composition call sites.

Import

import { scanLog } from "@graphrefly/ts/data-structures";

Signature

function scanLog(
	log: ReactiveLog<T>,
	initial: A,
	step: (acc: A, value: T) => A,
): Node<A>

Parameters

ParameterTypeDescription
logReactiveLog<T>log value used by the helper.
initialAinitial value used by the helper.
step(acc: A, value: T) => Astep value used by the helper.

Returns

A Node<A> value.

Example

import { scanLog } from "@graphrefly/ts/data-structures";

Source

packages/ts/src/graph/data-structures/reactive-log.ts