Skip to content
PACKAGES

tap()

tap: invoke a side effect on each DATA (function form) or on data/error/complete (observer form); values pass through unchanged. The observer form reads source terminals (completeWhenDepsComplete:false + errorWhenDepsError:false + terminalAsRealInput:true) so it can call error/complete then forward the terminal; the function form lets the substrate auto-cascade terminals.

import { tap } from "@graphrefly/ts/operators";
function tap(fnOrObserver: ((v: S) => void) | TapObserver<S>): Operator<S, S>
ParameterTypeDescription
fnOrObserver((v: S) => void) | TapObserver<S>fn or observer value used by the helper.

A Operator<S, S> value.

import { tap } from "@graphrefly/ts/operators";

packages/ts/src/graph/operators.ts