rescue()
rescue (alias catchError): replace an upstream ERROR with a recovered value. On source DATA →
forward; on source ERROR → emit recover(err) as DATA (if recover throws, forward THAT as
ERROR); on source COMPLETE → COMPLETE. After recovery the source is terminal-errored (dead) so no
further values flow — the recovered value is the final cached value (matches the frozen pure-ts
reference; it does NOT auto-COMPLETE, RxJS-catchError(()=>of(x)) divergence, flagged).
Import
Section titled “Import”import { rescue } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function rescue(recover: (err: unknown) => S): Operator<S, S>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
recover | (err: unknown) => S | recover value used by the helper. |
Returns
Section titled “Returns”A Operator<S, S> value.
Example
Section titled “Example”import { rescue } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/operators.ts