type-alias / @typed/router

MatchHandler

A route output or parameter-dependent output function.

Package version
1.0.0-beta.7
Category
Route handlers
Since
1.0.0

Import

import type { MatchHandler } from "@typed/router";

Signatures

export type MatchHandler<Params, A, E, R> = Fx.Fx<A, E, R> | Stream.Stream<A, E, R> | Effect.Effect<A, E, R> | A | ((params: RefSubject.RefSubject<Params>) => Fx.Fx<A, E, R> | Stream.Stream<A, E, R> | Effect.Effect<A, E, R> | A);

Why

Handlers can observe renderer-independent parameter RefSubjects and return any supported producer.

Ownership and lifetime

The type itself owns nothing. When selected, the executor invokes the function once for that handler identity and runs its normalized Fx in the route Scope.

Other public imports

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

Source