[]previous and next page

RouterState

Live state of the router, as accessors.

Live state of the router, as accessors.

Import#

ts
import type { RouterState } from "@shadow-js/router";

Signature#

ts
interface RouterState {
  location(): RouteLocation | undefined;
  status(): NavigationStatus;
  /** True while a navigation is pending past `pendingMs`. */
  pending(): boolean;
  /** The last navigation error or not-found signal (`undefined` when none). */
  error(): unknown;
  /** The chain on screen, including the not-found route when one renders. */
  matches(): readonly RenderedMatch[];
}

Members#

Name Type Description
location location(): RouteLocation | undefined
status status(): NavigationStatus
pending pending(): boolean True while a navigation is pending past pendingMs.
error error(): unknown The last navigation error or not-found signal (undefined when none).
matches matches(): readonly RenderedMatch[] The chain on screen, including the not-found route when one renders.