Skip to content

Interface: RouteLookupContract

API / @xmachines/play-dom-router / RouteLookupContract

Defined in: play-dom-router/src/connect-router.ts:15

The structural route lookup interface that connectRouter accepts.

Every object with these two methods satisfies the constraint. A RouteMap instance, a subclass, and a plain test object all work.

getPathByStateId can receive the stateId in the form "#stateId" or in the bare form "stateId". The bridge tries both forms. Therefore an implementation that holds one form only still resolves the path.

Methods

getPathByStateId()

getPathByStateId(id): string | null | undefined;

Defined in: play-dom-router/src/connect-router.ts:17

Parameters

ParameterType
idstring

Returns

string | null | undefined


getStateIdByPath()

getStateIdByPath(path): string | null | undefined;

Defined in: play-dom-router/src/connect-router.ts:16

Parameters

ParameterType
pathstring

Returns

string | null | undefined