@tanstack/router-core 0.0.1-beta.7 → 0.0.1-beta.9

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/router-core",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-beta.7",
4
+ "version": "0.0.1-beta.9",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router",
package/src/route.ts CHANGED
@@ -228,16 +228,3 @@ export function createRoute<
228
228
 
229
229
  return route
230
230
  }
231
-
232
- export function cascadeLoaderData(matches: RouteMatch<any, any>[]) {
233
- matches.forEach((match, index) => {
234
- const parent = matches[index - 1]
235
-
236
- if (parent) {
237
- match.loaderData = replaceEqualDeep(match.loaderData, {
238
- ...parent.loaderData,
239
- ...match.routeLoaderData,
240
- })
241
- }
242
- })
243
- }
package/src/router.ts CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  matchPathname,
24
24
  resolvePath,
25
25
  } from './path'
26
- import { AnyRoute, cascadeLoaderData, createRoute, Route } from './route'
26
+ import { AnyRoute, createRoute, Route } from './route'
27
27
  import {
28
28
  AnyLoaderData,
29
29
  AnyPathParams,
@@ -1282,3 +1282,16 @@ export function createRouter<
1282
1282
  function isCtrlEvent(e: MouseEvent) {
1283
1283
  return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)
1284
1284
  }
1285
+
1286
+ function cascadeLoaderData(matches: RouteMatch<any, any>[]) {
1287
+ matches.forEach((match, index) => {
1288
+ const parent = matches[index - 1]
1289
+
1290
+ if (parent) {
1291
+ match.loaderData = replaceEqualDeep(match.loaderData, {
1292
+ ...parent.loaderData,
1293
+ ...match.routeLoaderData,
1294
+ })
1295
+ }
1296
+ })
1297
+ }