GraphReFlyTS

API Reference

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

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

Signature

function rescue(recover: (err: unknown) => S): Operator<S, S>

Parameters

ParameterTypeDescription
recover(err: unknown) => Srecover value used by the helper.

Returns

A Operator<S, S> value.

Example

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

Source

packages/ts/src/graph/operators.ts