variable / @typed/router/AST

catchCause

Constructs a Match AST complete-cause boundary.

Package version
1.0.0-beta.13
Category
Matcher composition syntax
Since
1.0.0

Import

import { catchCause } from "@typed/router/AST";

Signatures

export declare const catchCause: (matches: ReadonlyArray<MatchAst>, f: (cause: RefSubject<Cause<any>>) => Fx<any, any, any>) => MatchAst.Catch;

Why

Fallback Fx output can observe full Effect causes without erasing defects or interruption.

Ownership and lifetime

catchCause returns a fresh plain AST node immediately and retains any supplied child nodes or arrays by reference; it acquires no external resource.

Source