Skip to content
Source
Sign inSign up
TanStack/query

Delete all queries when clearing query cache #31

Mergedcherniavskii(GitHub profile, opens in a new tab)merged 1 commit intomaster fromrefs/pull/31/headmerged by tannerlinsley View on GitHub

Showing 1 changed file with 1 addition and 6 deletions.

x
0 of 1 viewed, 1 left
1 addition and 6 deletionssrc/index.jsModified
View file
@@ -669,12 +669,7 @@
​
export function clearQueryCache() {
- queries = queries.filter(query => {
- if (!query.instances.length) {
- query.state.data = null
- return true
- }
- })
+ queries.length = 0;
​
function defaultQueryKeySerializerFn(queryKey) {