Skip to content

Interface: RouteMap

Documentation / @xmachines/play-router / RouteMap

Defined in: create-route-map.ts:27

Bidirectional route resolution interface returned by createRouteMap().

Resolves 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

resolve()

resolve(path): object;

Defined in: create-route-map.ts:44

Resolve 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 } = routeMap.resolve("/settings/account");
// { to: "#settings", params: { section: "account" } }
if (to) {
actor.send({ type: "play.route", to, params });
}
NameTypeDefined in
paramsRecord<string, string>create-route-map.ts:46
tostring | nullcreate-route-map.ts:45