Interface: RoutableActor
API / @xmachines/play-dom-router / RoutableActor
Defined in: play-router/src/types.ts:259
Minimal actor interface required by RouterBridgeBase and all framework router
adapters.
Using this interface instead of AbstractActor<AnyActorLogic> & Routable lets
RouterBridgeBase.actor.send be typed to accept PlayRouteEvent directly —
eliminating the unsafe (actor.send as (e: PlayRouteEvent) => void) cast that
existed when the actor was typed with the weaker EventObject constraint.
All AbstractActor subclasses satisfy this interface structurally because:
AbstractActorimplementssend(event: TEvent): voidwhereTEventaccepts anyEventObject, soPlayRouteEvent(a subtype) is always accepted.RoutableprovidescurrentRouteandinitialRoute.
Example
import type { RoutableActor } from "@xmachines/play-router";
class MyBridge extends RouterBridgeBase { constructor(actor: RoutableActor, routeMap: RouteMap) { super(actor, routeMap); }}Extended by
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
currentRoute | readonly | Computed<string | null> | TC39 Signal exposing the actor’s current URL path (or state ID). | play-router/src/types.ts:261 |
initialRoute | readonly | string | null | The route derived from the machine’s initial state — fixed at construction. Router bridges compare this against the browser URL to distinguish a deep-link (router wins) from a session restore (actor wins). | play-router/src/types.ts:267 |
Methods
send()
send(event): void;Defined in: play-router/src/types.ts:269
Send a route navigation event to the actor.
Parameters
| Parameter | Type |
|---|---|
event | PlayRouteEvent |
Returns
void