Skip to content
PACKAGES

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 { last } from "@graphrefly/ts/operators";
function last(pred?: (v: S) => boolean): Operator<S, S>
ParameterTypeDescription
pred(v: S) => booleanpred value used by the helper.

A Operator<S, S> value.

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

packages/ts/src/graph/operators.ts