Skip to content

Commit

Permalink
fix partial matches in single flight mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Sep 13, 2024
1 parent 49ce614 commit 5c87acc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/bright-melons-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/router": patch
---

fix partial matches in single flight mutations
2 changes: 1 addition & 1 deletion src/data/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function cache<T extends (...args: any) => any>(fn: T, name: string): Cac
if (dataOnly) {
const data = e && (e.router.data || (e.router.data = {}));
if (data && key in data) return data[key];
if (Array.isArray(dataOnly) && !dataOnly.includes(key)) {
if (Array.isArray(dataOnly) && !matchKey(key, dataOnly)) {
data[key] = undefined;
return Promise.resolve();
}
Expand Down

0 comments on commit 5c87acc

Please sign in to comment.