@tanstack/router-core 1.130.5 → 1.130.6
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 +2 -9
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +1 -1
- package/dist/esm/router.d.ts +1 -1
- package/dist/esm/router.js +2 -9
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +5 -14
package/dist/cjs/router.cjs
CHANGED
|
@@ -691,23 +691,16 @@ class RouterCore {
|
|
|
691
691
|
};
|
|
692
692
|
this.updateMatch = (id, updater) => {
|
|
693
693
|
var _a;
|
|
694
|
-
|
|
695
|
-
const isPending = (_a = this.state.pendingMatches) == null ? void 0 : _a.find((d) => d.id === id);
|
|
696
|
-
const isMatched = this.state.matches.find((d) => d.id === id);
|
|
697
|
-
const isCached = this.state.cachedMatches.find((d) => d.id === id);
|
|
698
|
-
const matchesKey = isPending ? "pendingMatches" : isMatched ? "matches" : isCached ? "cachedMatches" : "";
|
|
694
|
+
const matchesKey = ((_a = this.state.pendingMatches) == null ? void 0 : _a.some((d) => d.id === id)) ? "pendingMatches" : this.state.matches.some((d) => d.id === id) ? "matches" : this.state.cachedMatches.some((d) => d.id === id) ? "cachedMatches" : "";
|
|
699
695
|
if (matchesKey) {
|
|
700
696
|
this.__store.setState((s) => {
|
|
701
697
|
var _a2;
|
|
702
698
|
return {
|
|
703
699
|
...s,
|
|
704
|
-
[matchesKey]: (_a2 = s[matchesKey]) == null ? void 0 : _a2.map(
|
|
705
|
-
(d) => d.id === id ? updated = updater(d) : d
|
|
706
|
-
)
|
|
700
|
+
[matchesKey]: (_a2 = s[matchesKey]) == null ? void 0 : _a2.map((d) => d.id === id ? updater(d) : d)
|
|
707
701
|
};
|
|
708
702
|
});
|
|
709
703
|
}
|
|
710
|
-
return updated;
|
|
711
704
|
};
|
|
712
705
|
this.getMatch = (matchId) => {
|
|
713
706
|
var _a;
|