last()
last: emit the last value matching pred (or the last value) on the source’s COMPLETE.
completeWhenDepsComplete:false + terminalAsRealInput:true. EDGE (RxJS divergence, flagged):
RxJS last() throws EmptyError when no value matched; we COMPLETE without a value (no throw) —
GraphReFly has no “complete-or-throw” terminal and SENTINEL forbids emitting a
placeholder.
Import
Section titled “Import”import { last } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function last(pred?: (v: S) => boolean): Operator<S, S>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
pred | (v: S) => boolean | pred value used by the helper. |
Returns
Section titled “Returns”A Operator<S, S> value.
Example
Section titled “Example”import { last } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/operators.ts