@tanstack/router-core 1.134.13 → 1.134.15

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": "@tanstack/router-core",
3
- "version": "1.134.13",
3
+ "version": "1.134.15",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/router.ts CHANGED
@@ -1563,7 +1563,18 @@ export class RouterCore<
1563
1563
  }
1564
1564
 
1565
1565
  cancelMatches = () => {
1566
- this.state.pendingMatches?.forEach((match) => {
1566
+ const currentPendingMatches = this.state.matches.filter(
1567
+ (match) => match.status === 'pending',
1568
+ )
1569
+ const currentLoadingMatches = this.state.matches.filter(
1570
+ (match) => match.isFetching === 'loader',
1571
+ )
1572
+ const matchesToCancelArray = new Set([
1573
+ ...(this.state.pendingMatches ?? []),
1574
+ ...currentPendingMatches,
1575
+ ...currentLoadingMatches,
1576
+ ])
1577
+ matchesToCancelArray.forEach((match) => {
1567
1578
  this.cancelMatch(match.id)
1568
1579
  })
1569
1580
  }