function / @typed/svelte/Router

useRoute

Decodes reactive route parameters with Typed’s matcher. By default, leaving the ambient mount yields None. An explicit root confines the wildcard to that root, so paths outside it retain the native RouteNotFound failure.

Package version
1.0.0-beta.13
Category
function

Import

import { useRoute } from "@typed/svelte/Router";

Signatures

export declare function useRoute<Rt extends Route.Route.Any, ER = never>(route: Rt, options?: RouteOptions<Rt, ER>): import("./AsyncData.js").AsyncState<Option.Option<Route.Route.Type<Rt>>, Matcher.RouteNotFound | Matcher.RouteDecodeError | Matcher.RouteGuardError | ER>;

Other public imports

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

Source