function / @typed/router/RouteExecutor

makeRouteExecutor

Creates a scoped executor for route candidate decoding and selection.

Package version
1.0.0-beta.13
Category
Candidate execution
Since
1.0.0

Import

import { makeRouteExecutor } from "@typed/router/RouteExecutor";

Signatures

export declare function makeRouteExecutor<A, E = never, R = never>(): Effect.Effect<RouteExecutor<A, E, R>, never, R | Scope.Scope>;

Why

One owner coordinates layer rollback, guard order, layout reuse, catch boundaries, and handler finalization.

Ownership and lifetime

The returned Effect must run inside the Scope that will own the executor. Do not let the executor escape that Scope: closing it interrupts the selected handler and finalizes all Layer, layout, and catch children.

Examples

import * as Router from "@typed/router"
import * as Effect from "effect/Effect"

const useExecutor = Effect.scoped(
  Effect.gen(function* () {
    yield* Router.makeRouteExecutor<string>()
    yield* Effect.log("route executor is owned by this scope")
  })
)

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source