takeWhile()
takeWhile: emit values while pred holds; on the first value that fails pred, COMPLETE
WITHOUT emitting it (RxJS default, non-inclusive). Terminal-is-forever once it completes.
Import
Section titled “Import”import { takeWhile } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function takeWhile(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 { takeWhile } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/operators.ts