Skip to content

Interface: RouteMatcher

API / @xmachines/play-router / RouteMatcher

Defined in: create-route-matcher.ts:20

URL route matcher interface returned by createRouteMatcher().

Matches incoming URL paths to state IDs (with # prefix) and extracts route parameters. Used by RouterBridgeBase to translate router navigation events into play.route actor events.

See

Methods

match()

match(path): object;

Defined in: create-route-matcher.ts:37

Match a URL path to a state ID and params.

Parameters

ParameterTypeDescription
pathstringURL pathname (e.g., “/settings/account”)

Returns

object

Object with to (state ID with # prefix) and params

Example:

const { to, params } = routeMatcher.match("/settings/account");
// { to: "#settings", params: { section: "account" } }
if (to) {
actor.send({ type: "play.route", to, params });
}
NameTypeDefined in
paramsRecord<string, string>create-route-matcher.ts:39
tostring | nullcreate-route-matcher.ts:38