@tanstack/query-core 5.0.0-alpha.90 → 5.0.0-beta.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.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/index.d.cts +1 -1
- package/build/legacy/index.d.ts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +1 -1
- package/build/legacy/infiniteQueryObserver.d.ts +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/queriesObserver.d.cts +1 -1
- package/build/legacy/queriesObserver.d.ts +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-d035cb61.d.ts → queryClient-7060338a.d.ts} +7 -3
- package/build/legacy/{queryClient-158dd7f5.d.ts → queryClient-9264ae39.d.ts} +7 -3
- package/build/legacy/queryClient.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryObserver.cjs +5 -2
- 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 +5 -2
- 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/types.cjs.map +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.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/index.d.cts +1 -1
- package/build/modern/index.d.ts +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +1 -1
- package/build/modern/infiniteQueryObserver.d.ts +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/queriesObserver.d.cts +1 -1
- package/build/modern/queriesObserver.d.ts +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-d035cb61.d.ts → queryClient-7060338a.d.ts} +7 -3
- package/build/modern/{queryClient-158dd7f5.d.ts → queryClient-9264ae39.d.ts} +7 -3
- package/build/modern/queryClient.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryObserver.cjs +5 -2
- 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 +5 -2
- 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/types.cjs.map +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/queryObserver.ts +9 -3
- package/src/types.ts +9 -3
package/build/modern/utils.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aD as DataUpdateFunction, e as MutationFilters, f as QueryFilters, aE as QueryTypeFilter, U as Updater, aS as addToEnd, aT as addToStart, aG as functionalUpdate, h as hashKey, aK as hashQueryKeyByOptions, aN as isPlainArray, aO as isPlainObject, i as isServer, aH as isValidTimeout, k as keepPreviousData, aJ as matchMutation, m as matchQuery, aF as noop, aL as partialMatchKey, aR as replaceData, r as replaceEqualDeep, aQ as scheduleMicrotask, aM as shallowEqualObjects, aP as sleep, aI as timeUntilStale } from './queryClient-7060338a.js';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
package/build/modern/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aD as DataUpdateFunction, e as MutationFilters, f as QueryFilters, aE as QueryTypeFilter, U as Updater, aS as addToEnd, aT as addToStart, aG as functionalUpdate, h as hashKey, aK as hashQueryKeyByOptions, aN as isPlainArray, aO as isPlainObject, i as isServer, aH as isValidTimeout, k as keepPreviousData, aJ as matchMutation, m as matchQuery, aF as noop, aL as partialMatchKey, aR as replaceData, r as replaceEqualDeep, aQ as scheduleMicrotask, aM as shallowEqualObjects, aP as sleep, aI as timeUntilStale } from './queryClient-9264ae39.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
package/package.json
CHANGED
package/src/queryObserver.ts
CHANGED
|
@@ -612,15 +612,21 @@ export class QueryObserver<
|
|
|
612
612
|
}
|
|
613
613
|
|
|
614
614
|
const { notifyOnChangeProps } = this.options
|
|
615
|
+
const notifyOnChangePropsValue =
|
|
616
|
+
typeof notifyOnChangeProps === 'function'
|
|
617
|
+
? notifyOnChangeProps()
|
|
618
|
+
: notifyOnChangeProps
|
|
615
619
|
|
|
616
620
|
if (
|
|
617
|
-
|
|
618
|
-
(!
|
|
621
|
+
notifyOnChangePropsValue === 'all' ||
|
|
622
|
+
(!notifyOnChangePropsValue && !this.#trackedProps.size)
|
|
619
623
|
) {
|
|
620
624
|
return true
|
|
621
625
|
}
|
|
622
626
|
|
|
623
|
-
const includedProps = new Set(
|
|
627
|
+
const includedProps = new Set(
|
|
628
|
+
notifyOnChangePropsValue ?? this.#trackedProps,
|
|
629
|
+
)
|
|
624
630
|
|
|
625
631
|
if (this.options.throwOnError) {
|
|
626
632
|
includedProps.add('error')
|
package/src/types.ts
CHANGED
|
@@ -95,6 +95,11 @@ export type QueryMeta = Register extends {
|
|
|
95
95
|
|
|
96
96
|
export type NetworkMode = 'online' | 'always' | 'offlineFirst'
|
|
97
97
|
|
|
98
|
+
export type NotifyOnChangeProps =
|
|
99
|
+
| Array<keyof InfiniteQueryObserverResult>
|
|
100
|
+
| 'all'
|
|
101
|
+
| (() => Array<keyof InfiniteQueryObserverResult> | 'all')
|
|
102
|
+
|
|
98
103
|
export interface QueryOptions<
|
|
99
104
|
TQueryFnData = unknown,
|
|
100
105
|
TError = DefaultError,
|
|
@@ -261,9 +266,10 @@ export interface QueryObserverOptions<
|
|
|
261
266
|
* If set, the component will only re-render if any of the listed properties change.
|
|
262
267
|
* When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.
|
|
263
268
|
* When set to `'all'`, the component will re-render whenever a query is updated.
|
|
269
|
+
* When set to a function, the function will be executed to compute the list of properties.
|
|
264
270
|
* By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.
|
|
265
271
|
*/
|
|
266
|
-
notifyOnChangeProps?:
|
|
272
|
+
notifyOnChangeProps?: NotifyOnChangeProps
|
|
267
273
|
/**
|
|
268
274
|
* Whether errors should be thrown instead of setting the `error` property.
|
|
269
275
|
* If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.
|
|
@@ -292,8 +298,8 @@ export interface QueryObserverOptions<
|
|
|
292
298
|
_optimisticResults?: 'optimistic' | 'isRestoring'
|
|
293
299
|
}
|
|
294
300
|
|
|
295
|
-
export type WithRequired<T, K extends keyof T> =
|
|
296
|
-
|
|
301
|
+
export type WithRequired<T, K extends keyof T> = T & { [_ in K]: {} }
|
|
302
|
+
|
|
297
303
|
export type DefaultedQueryObserverOptions<
|
|
298
304
|
TQueryFnData = unknown,
|
|
299
305
|
TError = DefaultError,
|