Skip to main content
RouteManager is a small helper for client-side routing.

Export

  • routeManager

What it does

  • keeps a map of routes and the currently active route
  • navigates via history.pushState
  • resolves dynamic routes using URLPattern

Initialize and register routes

Register routes before calling loadRouteByCurrentUrl():
The route consists of a URL pattern, a panel key, and a translation key for the title.
Navigation uses history.pushState and handles browser back/forward through popstate. To resolve a URL before navigating:
Use disable() to temporarily disable navigation. removeActiveRoute() clears the saved route from sessionStorage.