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
- createRouteMap for the factory function
- BaseRouteMap for direct state ID ↔ path lookups without params extraction
Methods
resolve()
resolve(path): object;Defined in: create-route-map.ts:44
Resolve a URL path to a state ID and params.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | URL 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 });}| Name | Type | Defined in |
|---|---|---|
params | Record<string, string> | create-route-map.ts:46 |
to | string | null | create-route-map.ts:45 |