@tschk/moonshine-router 0.4.49 → 0.4.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tschk/moonshine-router",
3
- "version": "0.4.49",
3
+ "version": "0.4.80",
4
4
  "description": "Renderer-neutral route graph and matcher with optional React navigation",
5
5
  "license": "ISC",
6
6
  "type": "module",
@@ -24,8 +24,8 @@
24
24
  "test": "bun test"
25
25
  },
26
26
  "dependencies": {
27
- "@tschk/moonshine": "^0.4.48",
28
- "@tschk/moonshine-framework": "^0.4.48"
27
+ "@tschk/moonshine": "^0.4.80",
28
+ "@tschk/moonshine-framework": "^0.4.80"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/bun": "1.3.14",
package/src/index.ts CHANGED
@@ -13,6 +13,7 @@ export type { RouteGraph, RouteMatch } from "./graph.js";
13
13
  export {
14
14
  navigate,
15
15
  getLocation,
16
+ getRouter,
16
17
  useLocation,
17
18
  useHistory,
18
19
  useParams,
package/src/navigation.ts CHANGED
@@ -43,6 +43,11 @@ export function navigate(
43
43
  currentRouter().navigate(to, options);
44
44
  }
45
45
 
46
+ /** The router `navigate` targets: the innermost mounted one, else the fallback. */
47
+ export function getRouter(): MoonshineRouterInstance {
48
+ return currentRouter();
49
+ }
50
+
46
51
  /** Current pathname and query (reactive; active or fallback router). */
47
52
  export function getLocation(): string {
48
53
  return currentRouter().getLocation();