@tanstack/query-core 5.69.0 → 5.70.0
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/{hydration-BZgfn3GW.d.cts → hydration-CIqZ2rw6.d.cts} +3 -6
- package/build/legacy/{hydration-B_mC2U5v.d.ts → hydration-Cik0p0G0.d.ts} +3 -6
- package/build/legacy/hydration.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/index.cjs +2 -0
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +2 -2
- package/build/legacy/index.d.ts +2 -2
- package/build/legacy/index.js +2 -1
- package/build/legacy/index.js.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
- package/build/legacy/infiniteQueryObserver.cjs +5 -8
- package/build/legacy/infiniteQueryObserver.cjs.map +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +2 -2
- package/build/legacy/infiniteQueryObserver.d.ts +2 -2
- package/build/legacy/infiniteQueryObserver.js +5 -8
- package/build/legacy/infiniteQueryObserver.js.map +1 -1
- package/build/legacy/mutation.d.cts +1 -1
- package/build/legacy/mutation.d.ts +1 -1
- package/build/legacy/mutationCache.d.cts +1 -1
- package/build/legacy/mutationCache.d.ts +1 -1
- package/build/legacy/mutationObserver.d.cts +1 -1
- package/build/legacy/mutationObserver.d.ts +1 -1
- package/build/legacy/notifyManager.cjs +4 -1
- package/build/legacy/notifyManager.cjs.map +1 -1
- package/build/legacy/notifyManager.d.cts +2 -1
- package/build/legacy/notifyManager.d.ts +2 -1
- package/build/legacy/notifyManager.js +3 -1
- package/build/legacy/notifyManager.js.map +1 -1
- package/build/legacy/queriesObserver.cjs +2 -2
- package/build/legacy/queriesObserver.cjs.map +1 -1
- package/build/legacy/queriesObserver.d.cts +2 -2
- package/build/legacy/queriesObserver.d.ts +2 -2
- package/build/legacy/queriesObserver.js +2 -2
- package/build/legacy/queriesObserver.js.map +1 -1
- package/build/legacy/query.d.cts +1 -1
- package/build/legacy/query.d.ts +1 -1
- package/build/legacy/queryCache.d.cts +1 -1
- package/build/legacy/queryCache.d.ts +1 -1
- package/build/legacy/queryClient.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryObserver.cjs +4 -8
- package/build/legacy/queryObserver.cjs.map +1 -1
- package/build/legacy/queryObserver.d.cts +1 -1
- package/build/legacy/queryObserver.d.ts +1 -1
- package/build/legacy/queryObserver.js +4 -8
- package/build/legacy/queryObserver.js.map +1 -1
- package/build/legacy/retryer.d.cts +1 -1
- package/build/legacy/retryer.d.ts +1 -1
- package/build/legacy/streamedQuery.d.cts +1 -1
- package/build/legacy/streamedQuery.d.ts +1 -1
- package/build/legacy/types.d.cts +1 -1
- package/build/legacy/types.d.ts +1 -1
- package/build/legacy/utils.d.cts +1 -1
- package/build/legacy/utils.d.ts +1 -1
- package/build/modern/{hydration-BZgfn3GW.d.cts → hydration-CIqZ2rw6.d.cts} +3 -6
- package/build/modern/{hydration-B_mC2U5v.d.ts → hydration-Cik0p0G0.d.ts} +3 -6
- package/build/modern/hydration.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/index.cjs +2 -0
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +2 -2
- package/build/modern/index.d.ts +2 -2
- package/build/modern/index.js +2 -1
- package/build/modern/index.js.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -1
- package/build/modern/infiniteQueryObserver.cjs +5 -8
- package/build/modern/infiniteQueryObserver.cjs.map +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +2 -2
- package/build/modern/infiniteQueryObserver.d.ts +2 -2
- package/build/modern/infiniteQueryObserver.js +5 -8
- package/build/modern/infiniteQueryObserver.js.map +1 -1
- package/build/modern/mutation.d.cts +1 -1
- package/build/modern/mutation.d.ts +1 -1
- package/build/modern/mutationCache.d.cts +1 -1
- package/build/modern/mutationCache.d.ts +1 -1
- package/build/modern/mutationObserver.d.cts +1 -1
- package/build/modern/mutationObserver.d.ts +1 -1
- package/build/modern/notifyManager.cjs +4 -1
- package/build/modern/notifyManager.cjs.map +1 -1
- package/build/modern/notifyManager.d.cts +2 -1
- package/build/modern/notifyManager.d.ts +2 -1
- package/build/modern/notifyManager.js +3 -1
- package/build/modern/notifyManager.js.map +1 -1
- package/build/modern/queriesObserver.cjs +2 -2
- package/build/modern/queriesObserver.cjs.map +1 -1
- package/build/modern/queriesObserver.d.cts +2 -2
- package/build/modern/queriesObserver.d.ts +2 -2
- package/build/modern/queriesObserver.js +2 -2
- package/build/modern/queriesObserver.js.map +1 -1
- package/build/modern/query.d.cts +1 -1
- package/build/modern/query.d.ts +1 -1
- package/build/modern/queryCache.d.cts +1 -1
- package/build/modern/queryCache.d.ts +1 -1
- package/build/modern/queryClient.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryObserver.cjs +4 -8
- package/build/modern/queryObserver.cjs.map +1 -1
- package/build/modern/queryObserver.d.cts +1 -1
- package/build/modern/queryObserver.d.ts +1 -1
- package/build/modern/queryObserver.js +4 -8
- package/build/modern/queryObserver.js.map +1 -1
- package/build/modern/retryer.d.cts +1 -1
- package/build/modern/retryer.d.ts +1 -1
- package/build/modern/streamedQuery.d.cts +1 -1
- package/build/modern/streamedQuery.d.ts +1 -1
- package/build/modern/types.d.cts +1 -1
- package/build/modern/types.d.ts +1 -1
- package/build/modern/utils.d.cts +1 -1
- package/build/modern/utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/infiniteQueryObserver.ts +4 -9
- package/src/notifyManager.ts +3 -1
- package/src/queriesObserver.ts +1 -3
- package/src/queryObserver.ts +4 -16
package/src/queryObserver.ts
CHANGED
|
@@ -32,10 +32,6 @@ type QueryObserverListener<TData, TError> = (
|
|
|
32
32
|
result: QueryObserverResult<TData, TError>,
|
|
33
33
|
) => void
|
|
34
34
|
|
|
35
|
-
export interface NotifyOptions {
|
|
36
|
-
listeners?: boolean
|
|
37
|
-
}
|
|
38
|
-
|
|
39
35
|
interface ObserverFetchOptions extends FetchOptions {
|
|
40
36
|
throwOnError?: boolean
|
|
41
37
|
}
|
|
@@ -151,7 +147,6 @@ export class QueryObserver<
|
|
|
151
147
|
TQueryData,
|
|
152
148
|
TQueryKey
|
|
153
149
|
>,
|
|
154
|
-
notifyOptions?: NotifyOptions,
|
|
155
150
|
): void {
|
|
156
151
|
const prevOptions = this.options
|
|
157
152
|
const prevQuery = this.#currentQuery
|
|
@@ -200,7 +195,7 @@ export class QueryObserver<
|
|
|
200
195
|
}
|
|
201
196
|
|
|
202
197
|
// Update result
|
|
203
|
-
this.updateResult(
|
|
198
|
+
this.updateResult()
|
|
204
199
|
|
|
205
200
|
// Update stale interval if needed
|
|
206
201
|
if (
|
|
@@ -648,7 +643,7 @@ export class QueryObserver<
|
|
|
648
643
|
return nextResult
|
|
649
644
|
}
|
|
650
645
|
|
|
651
|
-
updateResult(
|
|
646
|
+
updateResult(): void {
|
|
652
647
|
const prevResult = this.#currentResult as
|
|
653
648
|
| QueryObserverResult<TData, TError>
|
|
654
649
|
| undefined
|
|
@@ -669,9 +664,6 @@ export class QueryObserver<
|
|
|
669
664
|
|
|
670
665
|
this.#currentResult = nextResult
|
|
671
666
|
|
|
672
|
-
// Determine which callbacks to trigger
|
|
673
|
-
const defaultNotifyOptions: NotifyOptions = {}
|
|
674
|
-
|
|
675
667
|
const shouldNotifyListeners = (): boolean => {
|
|
676
668
|
if (!prevResult) {
|
|
677
669
|
return true
|
|
@@ -706,11 +698,7 @@ export class QueryObserver<
|
|
|
706
698
|
})
|
|
707
699
|
}
|
|
708
700
|
|
|
709
|
-
|
|
710
|
-
defaultNotifyOptions.listeners = true
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
this.#notify({ ...defaultNotifyOptions, ...notifyOptions })
|
|
701
|
+
this.#notify({ listeners: shouldNotifyListeners() })
|
|
714
702
|
}
|
|
715
703
|
|
|
716
704
|
#updateQuery(): void {
|
|
@@ -740,7 +728,7 @@ export class QueryObserver<
|
|
|
740
728
|
}
|
|
741
729
|
}
|
|
742
730
|
|
|
743
|
-
#notify(notifyOptions:
|
|
731
|
+
#notify(notifyOptions: { listeners: boolean }): void {
|
|
744
732
|
notifyManager.batch(() => {
|
|
745
733
|
// First, trigger the listeners
|
|
746
734
|
if (notifyOptions.listeners) {
|