@tanstack/react-router 1.112.9 → 1.112.11
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/dist/cjs/router.cjs +12 -8
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +12 -8
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +13 -8
package/package.json
CHANGED
package/src/router.ts
CHANGED
|
@@ -2313,14 +2313,19 @@ export class Router<
|
|
|
2313
2313
|
if (executeBeforeLoad) {
|
|
2314
2314
|
// If we are not in the middle of a load OR the previous load failed, start it
|
|
2315
2315
|
try {
|
|
2316
|
-
updateMatch(matchId, (prev) =>
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2316
|
+
updateMatch(matchId, (prev) => {
|
|
2317
|
+
// explicitly capture the previous loadPromise
|
|
2318
|
+
const prevLoadPromise = prev.loadPromise
|
|
2319
|
+
return {
|
|
2320
|
+
...prev,
|
|
2321
|
+
loadPromise: createControlledPromise<void>(
|
|
2322
|
+
function demo() {
|
|
2323
|
+
prevLoadPromise?.resolve()
|
|
2324
|
+
},
|
|
2325
|
+
),
|
|
2326
|
+
beforeLoadPromise: createControlledPromise<void>(),
|
|
2327
|
+
}
|
|
2328
|
+
})
|
|
2324
2329
|
const abortController = new AbortController()
|
|
2325
2330
|
|
|
2326
2331
|
let pendingTimeout: ReturnType<typeof setTimeout>
|