find()
find: emit the first value matching pred, then COMPLETE. EDGE (RxJS divergence, flagged): RxJS
find emits undefined then COMPLETE when nothing matched — but undefined IS the SENTINEL
(R-sentinel), so a not-found source COMPLETE here emits a bare COMPLETE (no value).
Import
Section titled “Import”import { find } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function find(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 { find } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/operators.ts