@tanstack/router-core 1.130.2 → 1.130.5
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 +7 -6
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +7 -6
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +11 -6
package/package.json
CHANGED
package/src/router.ts
CHANGED
|
@@ -2078,11 +2078,12 @@ export class RouterCore<
|
|
|
2078
2078
|
}
|
|
2079
2079
|
|
|
2080
2080
|
getMatch: GetMatchFn = (matchId: string) => {
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2081
|
+
const findFn = (d: { id: string }) => d.id === matchId
|
|
2082
|
+
return (
|
|
2083
|
+
this.state.cachedMatches.find(findFn) ??
|
|
2084
|
+
this.state.pendingMatches?.find(findFn) ??
|
|
2085
|
+
this.state.matches.find(findFn)
|
|
2086
|
+
)
|
|
2086
2087
|
}
|
|
2087
2088
|
|
|
2088
2089
|
loadMatches = async ({
|
|
@@ -2867,7 +2868,11 @@ export class RouterCore<
|
|
|
2867
2868
|
: (route.options.gcTime ?? this.options.defaultGcTime)) ??
|
|
2868
2869
|
5 * 60 * 1000
|
|
2869
2870
|
|
|
2870
|
-
|
|
2871
|
+
const isError = d.status === 'error'
|
|
2872
|
+
if (isError) return true
|
|
2873
|
+
|
|
2874
|
+
const isStale = Date.now() - d.updatedAt >= gcTime
|
|
2875
|
+
return isStale
|
|
2871
2876
|
}
|
|
2872
2877
|
this.clearCache({ filter })
|
|
2873
2878
|
}
|