@tanstack/query-core
Advanced tools
Comparing version
@@ -97,2 +97,3 @@ import "./chunk-PXG64RU4.js"; | ||
const existingQueryIsPending = (query == null ? void 0 : query.state.status) === "pending"; | ||
const existingQueryIsFetching = (query == null ? void 0 : query.state.fetchStatus) === "fetching"; | ||
if (query) { | ||
@@ -129,3 +130,3 @@ const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration | ||
} | ||
if (promise && !existingQueryIsPending && // Only hydrate if dehydration is newer than any existing data, | ||
if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, | ||
// this is always true for new queries | ||
@@ -132,0 +133,0 @@ (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { |
@@ -90,2 +90,3 @@ // src/hydration.ts | ||
const existingQueryIsPending = query?.state.status === "pending"; | ||
const existingQueryIsFetching = query?.state.fetchStatus === "fetching"; | ||
if (query) { | ||
@@ -122,3 +123,3 @@ const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration | ||
} | ||
if (promise && !existingQueryIsPending && // Only hydrate if dehydration is newer than any existing data, | ||
if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, | ||
// this is always true for new queries | ||
@@ -125,0 +126,0 @@ (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { |
{ | ||
"name": "@tanstack/query-core", | ||
"version": "5.77.0", | ||
"version": "5.77.1", | ||
"description": "The framework agnostic core that powers TanStack Query", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
@@ -206,2 +206,3 @@ import { tryResolveSync } from './thenable' | ||
const existingQueryIsPending = query?.state.status === 'pending' | ||
const existingQueryIsFetching = query?.state.fetchStatus === 'fetching' | ||
@@ -253,2 +254,3 @@ // Do not hydrate if an existing query exists with newer data | ||
!existingQueryIsPending && | ||
!existingQueryIsFetching && | ||
// Only hydrate if dehydration is newer than any existing data, | ||
@@ -255,0 +257,0 @@ // this is always true for new queries |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2016945
0.06%22964
0.03%