Skip to content

lit-ui-router-signals / RouterSignalControllerOptions

Interface: RouterSignalControllerOptions<T> ​

Defined in: router-signal-controller.ts:11

Options for RouterSignalController.

Extends ​

Type Parameters ​

Type Parameter
T

Properties ​

PropertyTypeDescriptionInherited fromDefined in
equals?(a, b) => booleanComparer deciding whether the selected value changed, passed to the selector's Signal.Computed. Defaults to Object.is.SignalControllerOptions.equalssignal-controller.ts:24
initialValue?TValue exposed on .value before the first read — that is, before hostConnected, and on any host that renders while disconnected (SSR). Without it .value is undefined until the host connects.SignalControllerOptions.initialValuesignal-controller.ts:18
onChange?(value) => voidInvoked (before host.requestUpdate()) whenever the selected value changes — and once on every host (re)connect. Use for effects such as resetting component state from route params.SignalControllerOptions.onChangesignal-controller.ts:11
router?| UIRouter | (() => | UIRouter | undefined)Explicit router instance, or a thunk returning one. When omitted (or the thunk returns undefined), the controller takes the router an enclosing withRouterSync scoped at construction (a server render), and otherwise asks the nearest router provider on hostConnected: over context-request first (via requestRouter with subscribe: true), then over the ui-router-context event (via UIRouterLitElement.seekRouter) when nobody answers. A discovered router is rebound when a subscribed provider hands over the router that replaces its placeholder. An explicit or scoped router is read at construction, so .value is live before the host connects. A thunk is resolved at construction and again on each hostConnected; a router it returns replaces the one followed, as RouterSignalController.setRouter does. An explicit router is never replaced by one a provider hands over.-router-signal-controller.ts:32