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
| Parameter | Type | Description |
|---|---|---|
log | ReactiveLog<T> | log value used by the helper. |
initial | A | initial value used by the helper. |
step | (acc: A, value: T) => A | step 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