Type Alias: RouteDataResolver
API / @xmachines/play-router / index / RouteDataResolver
type RouteDataResolver = (args) => RouteData;Defined in: packages/play-router/src/types.ts:28
The function form of RouteObject.data.
The signature mirrors WithDynamicParams of XState: the resolver reads the context
of the machine and the event that asks for the route, and it returns the data.
The resolver reads every field of the event, and event.data among them: that field
carries what the SENDER of the event supplied, and the resolver decides how it
combines with what the state declares. The data that the resolver RETURNS goes to
context.data, and it does not go back onto the event.
Parameters
| Parameter | Type |
|---|---|
args | { context: unknown; event: PlayRouteEvent; } |
args.context | unknown |
args.event | PlayRouteEvent |