@tanstack/query-core 5.24.1 → 5.24.2
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/build/legacy/query.cjs +2 -2
- package/build/legacy/query.cjs.map +1 -1
- package/build/legacy/query.js +2 -2
- package/build/legacy/query.js.map +1 -1
- package/build/legacy/queryClient.cjs +5 -5
- package/build/legacy/queryClient.cjs.map +1 -1
- package/build/legacy/queryClient.js +5 -5
- package/build/legacy/queryClient.js.map +1 -1
- package/build/legacy/queryObserver.cjs +5 -5
- package/build/legacy/queryObserver.cjs.map +1 -1
- package/build/legacy/queryObserver.js +5 -5
- package/build/legacy/queryObserver.js.map +1 -1
- package/build/legacy/utils.cjs +2 -2
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.js +2 -2
- package/build/legacy/utils.js.map +1 -1
- package/build/modern/query.cjs +2 -2
- package/build/modern/query.cjs.map +1 -1
- package/build/modern/query.js +2 -2
- package/build/modern/query.js.map +1 -1
- package/build/modern/queryClient.cjs +5 -5
- package/build/modern/queryClient.cjs.map +1 -1
- package/build/modern/queryClient.js +5 -5
- package/build/modern/queryClient.js.map +1 -1
- package/build/modern/queryObserver.cjs +5 -5
- package/build/modern/queryObserver.cjs.map +1 -1
- package/build/modern/queryObserver.js +5 -5
- package/build/modern/queryObserver.js.map +1 -1
- package/build/modern/utils.cjs +2 -2
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.js +2 -2
- package/build/modern/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/query.ts +2 -2
- package/src/queryClient.ts +5 -8
- package/src/queryObserver.ts +6 -6
- package/src/utils.ts +2 -5
package/src/queryObserver.ts
CHANGED
|
@@ -147,7 +147,7 @@ export class QueryObserver<
|
|
|
147
147
|
this.options = this.#client.defaultQueryOptions(options)
|
|
148
148
|
|
|
149
149
|
if (
|
|
150
|
-
|
|
150
|
+
this.options.enabled !== undefined &&
|
|
151
151
|
typeof this.options.enabled !== 'boolean'
|
|
152
152
|
) {
|
|
153
153
|
throw new Error('Expected enabled to be a boolean')
|
|
@@ -454,7 +454,7 @@ export class QueryObserver<
|
|
|
454
454
|
}
|
|
455
455
|
|
|
456
456
|
// Select data if needed
|
|
457
|
-
if (options.select &&
|
|
457
|
+
if (options.select && state.data !== undefined) {
|
|
458
458
|
// Memoize select result
|
|
459
459
|
if (
|
|
460
460
|
prevResult &&
|
|
@@ -481,8 +481,8 @@ export class QueryObserver<
|
|
|
481
481
|
|
|
482
482
|
// Show placeholder data if needed
|
|
483
483
|
if (
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
options.placeholderData !== undefined &&
|
|
485
|
+
data === undefined &&
|
|
486
486
|
status === 'pending'
|
|
487
487
|
) {
|
|
488
488
|
let placeholderData
|
|
@@ -503,7 +503,7 @@ export class QueryObserver<
|
|
|
503
503
|
this.#lastQueryWithDefinedData as any,
|
|
504
504
|
)
|
|
505
505
|
: options.placeholderData
|
|
506
|
-
if (options.select &&
|
|
506
|
+
if (options.select && placeholderData !== undefined) {
|
|
507
507
|
try {
|
|
508
508
|
placeholderData = options.select(placeholderData)
|
|
509
509
|
this.#selectError = null
|
|
@@ -513,7 +513,7 @@ export class QueryObserver<
|
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
-
if (
|
|
516
|
+
if (placeholderData !== undefined) {
|
|
517
517
|
status = 'success'
|
|
518
518
|
data = replaceData(
|
|
519
519
|
prevResult?.data,
|
package/src/utils.ts
CHANGED
|
@@ -122,10 +122,7 @@ export function matchQuery(
|
|
|
122
122
|
return false
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
if (
|
|
126
|
-
typeof fetchStatus !== 'undefined' &&
|
|
127
|
-
fetchStatus !== query.state.fetchStatus
|
|
128
|
-
) {
|
|
125
|
+
if (fetchStatus && fetchStatus !== query.state.fetchStatus) {
|
|
129
126
|
return false
|
|
130
127
|
}
|
|
131
128
|
|
|
@@ -288,7 +285,7 @@ export function isPlainObject(o: any): o is Object {
|
|
|
288
285
|
|
|
289
286
|
// If has no constructor
|
|
290
287
|
const ctor = o.constructor
|
|
291
|
-
if (
|
|
288
|
+
if (ctor === undefined) {
|
|
292
289
|
return true
|
|
293
290
|
}
|
|
294
291
|
|