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
Section titled “Import”import { tap } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function tap(fnOrObserver: ((v: S) => void) | TapObserver<S>): Operator<S, S>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
fnOrObserver | ((v: S) => void) | TapObserver<S> | fn or observer value used by the helper. |
Returns
Section titled “Returns”A Operator<S, S> value.
Example
Section titled “Example”import { tap } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/operators.ts