variable / @typed/router/AST

layer

Wraps Match AST nodes with Effect Layer dependencies.

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

Import

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

Signatures

export declare const layer: (matches: ReadonlyArray<MatchAst>, deps: ReadonlyArray<AnyLayer>) => MatchAst.Layer;

Why

Candidate acquisition and rollback boundaries stay local to the wrapped route subtree.

Ownership and lifetime

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

Source