@tanstack/query-core 5.51.9 → 5.51.15
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/focusManager.cjs.map +1 -1
- package/build/legacy/focusManager.js.map +1 -1
- package/build/legacy/{hydration-CKW1qemZ.d.cts → hydration-DYAZtSdq.d.cts} +1 -1
- package/build/legacy/{hydration-Bnn1iiSg.d.ts → hydration-DtrabBHC.d.ts} +1 -1
- package/build/legacy/hydration.cjs.map +1 -1
- package/build/legacy/hydration.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/hydration.js.map +1 -1
- package/build/legacy/index.cjs +3 -0
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +1 -1
- package/build/legacy/index.d.ts +1 -1
- package/build/legacy/index.js +2 -0
- package/build/legacy/index.js.map +1 -1
- package/build/legacy/infiniteQueryBehavior.cjs +3 -0
- package/build/legacy/infiniteQueryBehavior.cjs.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
- package/build/legacy/infiniteQueryBehavior.js +3 -0
- package/build/legacy/infiniteQueryBehavior.js.map +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/onlineManager.cjs.map +1 -1
- package/build/legacy/onlineManager.js.map +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.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryObserver.d.cts +1 -1
- package/build/legacy/queryObserver.d.ts +1 -1
- package/build/legacy/retryer.d.cts +1 -1
- package/build/legacy/retryer.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/focusManager.cjs.map +1 -1
- package/build/modern/focusManager.js.map +1 -1
- package/build/modern/{hydration-CKW1qemZ.d.cts → hydration-DYAZtSdq.d.cts} +1 -1
- package/build/modern/{hydration-Bnn1iiSg.d.ts → hydration-DtrabBHC.d.ts} +1 -1
- package/build/modern/hydration.cjs.map +1 -1
- package/build/modern/hydration.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/hydration.js.map +1 -1
- package/build/modern/index.cjs +3 -0
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +1 -1
- package/build/modern/index.d.ts +1 -1
- package/build/modern/index.js +2 -0
- package/build/modern/index.js.map +1 -1
- package/build/modern/infiniteQueryBehavior.cjs +3 -0
- package/build/modern/infiniteQueryBehavior.cjs.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -1
- package/build/modern/infiniteQueryBehavior.js +3 -0
- package/build/modern/infiniteQueryBehavior.js.map +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/onlineManager.cjs.map +1 -1
- package/build/modern/onlineManager.js.map +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.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryObserver.d.cts +1 -1
- package/build/modern/queryObserver.d.ts +1 -1
- package/build/modern/retryer.d.cts +1 -1
- package/build/modern/retryer.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/__tests__/notifyManager.test.tsx +2 -2
- package/src/__tests__/onlineManager.test.tsx +1 -1
- package/src/__tests__/queryClient.test.tsx +8 -2
- package/src/__tests__/queryObserver.test.tsx +7 -7
- package/src/focusManager.ts +2 -2
- package/src/hydration.ts +2 -2
- package/src/index.ts +2 -1
- package/src/infiniteQueryBehavior.ts +3 -0
- package/src/onlineManager.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { at as QueryObserverResult, b as QueryClient, a3 as QueryObserverOptions, aZ as NotifyOptions, u as Query, z as QueryKey, c as QueryObserver } from './hydration-
|
|
1
|
+
import { at as QueryObserverResult, b as QueryClient, a3 as QueryObserverOptions, aZ as NotifyOptions, u as Query, z as QueryKey, c as QueryObserver } from './hydration-DtrabBHC.js';
|
|
2
2
|
import { Subscribable } from './subscribable.js';
|
|
3
3
|
import './removable.js';
|
|
4
4
|
|
package/build/modern/query.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.cjs';
|
|
2
|
-
export { b2 as Action, a_ as FetchContext, a$ as FetchDirection, b0 as FetchMeta, b1 as FetchOptions, u as Query, aX as QueryBehavior, t as QueryState, b3 as SetStateOptions, b4 as fetchState } from './hydration-
|
|
2
|
+
export { b2 as Action, a_ as FetchContext, a$ as FetchDirection, b0 as FetchMeta, b1 as FetchOptions, u as Query, aX as QueryBehavior, t as QueryState, b3 as SetStateOptions, b4 as fetchState } from './hydration-DYAZtSdq.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
package/build/modern/query.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.js';
|
|
2
|
-
export { b2 as Action, a_ as FetchContext, a$ as FetchDirection, b0 as FetchMeta, b1 as FetchOptions, u as Query, aX as QueryBehavior, t as QueryState, b3 as SetStateOptions, b4 as fetchState } from './hydration-
|
|
2
|
+
export { b2 as Action, a_ as FetchContext, a$ as FetchDirection, b0 as FetchMeta, b1 as FetchOptions, u as Query, aX as QueryBehavior, t as QueryState, b3 as SetStateOptions, b4 as fetchState } from './hydration-DtrabBHC.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './subscribable.cjs';
|
|
2
|
-
export { aZ as NotifyOptions, aY as ObserverFetchOptions, c as QueryObserver } from './hydration-
|
|
2
|
+
export { aZ as NotifyOptions, aY as ObserverFetchOptions, c as QueryObserver } from './hydration-DYAZtSdq.cjs';
|
|
3
3
|
import './removable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './subscribable.js';
|
|
2
|
-
export { aZ as NotifyOptions, aY as ObserverFetchOptions, c as QueryObserver } from './hydration-
|
|
2
|
+
export { aZ as NotifyOptions, aY as ObserverFetchOptions, c as QueryObserver } from './hydration-DtrabBHC.js';
|
|
3
3
|
import './removable.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CancelledError, br as RetryDelayValue, bq as RetryValue, bp as Retryer, bs as canFetch, bt as createRetryer, l as isCancelledError } from './hydration-
|
|
1
|
+
export { C as CancelledError, br as RetryDelayValue, bq as RetryValue, bp as Retryer, bs as canFetch, bt as createRetryer, l as isCancelledError } from './hydration-DYAZtSdq.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CancelledError, br as RetryDelayValue, bq as RetryValue, bp as Retryer, bs as canFetch, bt as createRetryer, l as isCancelledError } from './hydration-
|
|
1
|
+
export { C as CancelledError, br as RetryDelayValue, bq as RetryValue, bp as Retryer, bs as canFetch, bt as createRetryer, l as isCancelledError } from './hydration-DtrabBHC.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
package/build/modern/types.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { aT as CancelOptions, B as DataTag, y as DefaultError, aS as DefaultOptions, a8 as DefaultedInfiniteQueryObserverOptions, a6 as DefaultedQueryObserverOptions, aA as DefinedInfiniteQueryObserverResult, as as DefinedQueryObserverResult, G as Enabled, aa as EnsureQueryDataOptions, ab as FetchInfiniteQueryOptions, ai as FetchNextPageOptions, aj as FetchPreviousPageOptions, a9 as FetchQueryOptions, al as FetchStatus, W as GetNextPageParamFunction, V as GetPreviousPageParamFunction, X as InfiniteData, au as InfiniteQueryObserverBaseResult, ax as InfiniteQueryObserverLoadingErrorResult, aw as InfiniteQueryObserverLoadingResult, a7 as InfiniteQueryObserverOptions, av as InfiniteQueryObserverPendingResult, ay as InfiniteQueryObserverRefetchErrorResult, aB as InfiniteQueryObserverResult, az as InfiniteQueryObserverSuccessResult, a1 as InfiniteQueryPageParamsOptions, K as InitialDataFunction, a0 as InitialPageParam, ag as InvalidateOptions, ae as InvalidateQueryFilters, aK as MutateFunction, aJ as MutateOptions, aG as MutationFunction, aC as MutationKey, aF as MutationMeta, aL as MutationObserverBaseResult, aO as MutationObserverErrorResult, aM as MutationObserverIdleResult, aN as MutationObserverLoadingResult, aI as MutationObserverOptions, aQ as MutationObserverResult, aP as MutationObserverSuccessResult, aH as MutationOptions, aE as MutationScope, aD as MutationStatus, Z as NetworkMode, N as NoInfer, aW as NotifyEvent, aV as NotifyEventType, _ as NotifyOnChangeProps, O as OmitKeyof, a5 as Optional, P as PlaceholderDataFunction, L as QueriesPlaceholderDataFunction, aR as QueryClientConfig, E as QueryFunction, J as QueryFunctionContext, z as QueryKey, T as QueryKeyHashFunction, Y as QueryMeta, am as QueryObserverBaseResult, ap as QueryObserverLoadingErrorResult, ao as QueryObserverLoadingResult, a3 as QueryObserverOptions, an as QueryObserverPendingResult, aq as QueryObserverRefetchErrorResult, at as QueryObserverResult, ar as QueryObserverSuccessResult, $ as QueryOptions, I as QueryPersister, ak as QueryStatus, ad as RefetchOptions, af as RefetchQueryFilters, R as Register, ah as ResetOptions, ac as ResultOptions, aU as SetDataOptions, F as StaleTime, a2 as ThrowOnError, a4 as WithRequired, A as dataTagSymbol } from './hydration-
|
|
1
|
+
export { aT as CancelOptions, B as DataTag, y as DefaultError, aS as DefaultOptions, a8 as DefaultedInfiniteQueryObserverOptions, a6 as DefaultedQueryObserverOptions, aA as DefinedInfiniteQueryObserverResult, as as DefinedQueryObserverResult, G as Enabled, aa as EnsureQueryDataOptions, ab as FetchInfiniteQueryOptions, ai as FetchNextPageOptions, aj as FetchPreviousPageOptions, a9 as FetchQueryOptions, al as FetchStatus, W as GetNextPageParamFunction, V as GetPreviousPageParamFunction, X as InfiniteData, au as InfiniteQueryObserverBaseResult, ax as InfiniteQueryObserverLoadingErrorResult, aw as InfiniteQueryObserverLoadingResult, a7 as InfiniteQueryObserverOptions, av as InfiniteQueryObserverPendingResult, ay as InfiniteQueryObserverRefetchErrorResult, aB as InfiniteQueryObserverResult, az as InfiniteQueryObserverSuccessResult, a1 as InfiniteQueryPageParamsOptions, K as InitialDataFunction, a0 as InitialPageParam, ag as InvalidateOptions, ae as InvalidateQueryFilters, aK as MutateFunction, aJ as MutateOptions, aG as MutationFunction, aC as MutationKey, aF as MutationMeta, aL as MutationObserverBaseResult, aO as MutationObserverErrorResult, aM as MutationObserverIdleResult, aN as MutationObserverLoadingResult, aI as MutationObserverOptions, aQ as MutationObserverResult, aP as MutationObserverSuccessResult, aH as MutationOptions, aE as MutationScope, aD as MutationStatus, Z as NetworkMode, N as NoInfer, aW as NotifyEvent, aV as NotifyEventType, _ as NotifyOnChangeProps, O as OmitKeyof, a5 as Optional, P as PlaceholderDataFunction, L as QueriesPlaceholderDataFunction, aR as QueryClientConfig, E as QueryFunction, J as QueryFunctionContext, z as QueryKey, T as QueryKeyHashFunction, Y as QueryMeta, am as QueryObserverBaseResult, ap as QueryObserverLoadingErrorResult, ao as QueryObserverLoadingResult, a3 as QueryObserverOptions, an as QueryObserverPendingResult, aq as QueryObserverRefetchErrorResult, at as QueryObserverResult, ar as QueryObserverSuccessResult, $ as QueryOptions, I as QueryPersister, ak as QueryStatus, ad as RefetchOptions, af as RefetchQueryFilters, R as Register, ah as ResetOptions, ac as ResultOptions, aU as SetDataOptions, F as StaleTime, a2 as ThrowOnError, a4 as WithRequired, A as dataTagSymbol } from './hydration-DYAZtSdq.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
package/build/modern/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { aT as CancelOptions, B as DataTag, y as DefaultError, aS as DefaultOptions, a8 as DefaultedInfiniteQueryObserverOptions, a6 as DefaultedQueryObserverOptions, aA as DefinedInfiniteQueryObserverResult, as as DefinedQueryObserverResult, G as Enabled, aa as EnsureQueryDataOptions, ab as FetchInfiniteQueryOptions, ai as FetchNextPageOptions, aj as FetchPreviousPageOptions, a9 as FetchQueryOptions, al as FetchStatus, W as GetNextPageParamFunction, V as GetPreviousPageParamFunction, X as InfiniteData, au as InfiniteQueryObserverBaseResult, ax as InfiniteQueryObserverLoadingErrorResult, aw as InfiniteQueryObserverLoadingResult, a7 as InfiniteQueryObserverOptions, av as InfiniteQueryObserverPendingResult, ay as InfiniteQueryObserverRefetchErrorResult, aB as InfiniteQueryObserverResult, az as InfiniteQueryObserverSuccessResult, a1 as InfiniteQueryPageParamsOptions, K as InitialDataFunction, a0 as InitialPageParam, ag as InvalidateOptions, ae as InvalidateQueryFilters, aK as MutateFunction, aJ as MutateOptions, aG as MutationFunction, aC as MutationKey, aF as MutationMeta, aL as MutationObserverBaseResult, aO as MutationObserverErrorResult, aM as MutationObserverIdleResult, aN as MutationObserverLoadingResult, aI as MutationObserverOptions, aQ as MutationObserverResult, aP as MutationObserverSuccessResult, aH as MutationOptions, aE as MutationScope, aD as MutationStatus, Z as NetworkMode, N as NoInfer, aW as NotifyEvent, aV as NotifyEventType, _ as NotifyOnChangeProps, O as OmitKeyof, a5 as Optional, P as PlaceholderDataFunction, L as QueriesPlaceholderDataFunction, aR as QueryClientConfig, E as QueryFunction, J as QueryFunctionContext, z as QueryKey, T as QueryKeyHashFunction, Y as QueryMeta, am as QueryObserverBaseResult, ap as QueryObserverLoadingErrorResult, ao as QueryObserverLoadingResult, a3 as QueryObserverOptions, an as QueryObserverPendingResult, aq as QueryObserverRefetchErrorResult, at as QueryObserverResult, ar as QueryObserverSuccessResult, $ as QueryOptions, I as QueryPersister, ak as QueryStatus, ad as RefetchOptions, af as RefetchQueryFilters, R as Register, ah as ResetOptions, ac as ResultOptions, aU as SetDataOptions, F as StaleTime, a2 as ThrowOnError, a4 as WithRequired, A as dataTagSymbol } from './hydration-
|
|
1
|
+
export { aT as CancelOptions, B as DataTag, y as DefaultError, aS as DefaultOptions, a8 as DefaultedInfiniteQueryObserverOptions, a6 as DefaultedQueryObserverOptions, aA as DefinedInfiniteQueryObserverResult, as as DefinedQueryObserverResult, G as Enabled, aa as EnsureQueryDataOptions, ab as FetchInfiniteQueryOptions, ai as FetchNextPageOptions, aj as FetchPreviousPageOptions, a9 as FetchQueryOptions, al as FetchStatus, W as GetNextPageParamFunction, V as GetPreviousPageParamFunction, X as InfiniteData, au as InfiniteQueryObserverBaseResult, ax as InfiniteQueryObserverLoadingErrorResult, aw as InfiniteQueryObserverLoadingResult, a7 as InfiniteQueryObserverOptions, av as InfiniteQueryObserverPendingResult, ay as InfiniteQueryObserverRefetchErrorResult, aB as InfiniteQueryObserverResult, az as InfiniteQueryObserverSuccessResult, a1 as InfiniteQueryPageParamsOptions, K as InitialDataFunction, a0 as InitialPageParam, ag as InvalidateOptions, ae as InvalidateQueryFilters, aK as MutateFunction, aJ as MutateOptions, aG as MutationFunction, aC as MutationKey, aF as MutationMeta, aL as MutationObserverBaseResult, aO as MutationObserverErrorResult, aM as MutationObserverIdleResult, aN as MutationObserverLoadingResult, aI as MutationObserverOptions, aQ as MutationObserverResult, aP as MutationObserverSuccessResult, aH as MutationOptions, aE as MutationScope, aD as MutationStatus, Z as NetworkMode, N as NoInfer, aW as NotifyEvent, aV as NotifyEventType, _ as NotifyOnChangeProps, O as OmitKeyof, a5 as Optional, P as PlaceholderDataFunction, L as QueriesPlaceholderDataFunction, aR as QueryClientConfig, E as QueryFunction, J as QueryFunctionContext, z as QueryKey, T as QueryKeyHashFunction, Y as QueryMeta, am as QueryObserverBaseResult, ap as QueryObserverLoadingErrorResult, ao as QueryObserverLoadingResult, a3 as QueryObserverOptions, an as QueryObserverPendingResult, aq as QueryObserverRefetchErrorResult, at as QueryObserverResult, ar as QueryObserverSuccessResult, $ as QueryOptions, I as QueryPersister, ak as QueryStatus, ad as RefetchOptions, af as RefetchQueryFilters, R as Register, ah as ResetOptions, ac as ResultOptions, aU as SetDataOptions, F as StaleTime, a2 as ThrowOnError, a4 as WithRequired, A as dataTagSymbol } from './hydration-DtrabBHC.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
package/build/modern/utils.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { g as MutationFilters, j as QueryFilters, b5 as QueryTypeFilter, S as SkipToken, U as Updater, bj as addToEnd, bk as addToStart, bl as ensureQueryFn, b7 as functionalUpdate, h as hashKey, bc as hashQueryKeyByOptions, bf as isPlainArray, bg as isPlainObject, i as isServer, b8 as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, b6 as noop, bd as partialMatchKey, bi as replaceData, r as replaceEqualDeep, bb as resolveEnabled, ba as resolveStaleTime, be as shallowEqualObjects, s as skipToken, bh as sleep, b9 as timeUntilStale } from './hydration-
|
|
1
|
+
export { g as MutationFilters, j as QueryFilters, b5 as QueryTypeFilter, S as SkipToken, U as Updater, bj as addToEnd, bk as addToStart, bl as ensureQueryFn, b7 as functionalUpdate, h as hashKey, bc as hashQueryKeyByOptions, bf as isPlainArray, bg as isPlainObject, i as isServer, b8 as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, b6 as noop, bd as partialMatchKey, bi as replaceData, r as replaceEqualDeep, bb as resolveEnabled, ba as resolveStaleTime, be as shallowEqualObjects, s as skipToken, bh as sleep, b9 as timeUntilStale } from './hydration-DYAZtSdq.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
package/build/modern/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { g as MutationFilters, j as QueryFilters, b5 as QueryTypeFilter, S as SkipToken, U as Updater, bj as addToEnd, bk as addToStart, bl as ensureQueryFn, b7 as functionalUpdate, h as hashKey, bc as hashQueryKeyByOptions, bf as isPlainArray, bg as isPlainObject, i as isServer, b8 as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, b6 as noop, bd as partialMatchKey, bi as replaceData, r as replaceEqualDeep, bb as resolveEnabled, ba as resolveStaleTime, be as shallowEqualObjects, s as skipToken, bh as sleep, b9 as timeUntilStale } from './hydration-
|
|
1
|
+
export { g as MutationFilters, j as QueryFilters, b5 as QueryTypeFilter, S as SkipToken, U as Updater, bj as addToEnd, bk as addToStart, bl as ensureQueryFn, b7 as functionalUpdate, h as hashKey, bc as hashQueryKeyByOptions, bf as isPlainArray, bg as isPlainObject, i as isServer, b8 as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, b6 as noop, bd as partialMatchKey, bi as replaceData, r as replaceEqualDeep, bb as resolveEnabled, ba as resolveStaleTime, be as shallowEqualObjects, s as skipToken, bh as sleep, b9 as timeUntilStale } from './hydration-DtrabBHC.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
package/package.json
CHANGED
|
@@ -74,12 +74,12 @@ describe('notifyManager', () => {
|
|
|
74
74
|
// we define some fn with its signature:
|
|
75
75
|
const fn: (a: string, b: number) => string = (a, b) => a + b
|
|
76
76
|
|
|
77
|
-
//now someFn expect to be called with args [a: string, b: number]
|
|
77
|
+
// now someFn expect to be called with args [a: string, b: number]
|
|
78
78
|
const someFn = notifyManagerTest.batchCalls(fn)
|
|
79
79
|
|
|
80
80
|
someFn('im happy', 4)
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
// @ts-expect-error
|
|
83
83
|
someFn('im not happy', false)
|
|
84
84
|
})
|
|
85
85
|
})
|
|
@@ -12,7 +12,7 @@ describe('onlineManager', () => {
|
|
|
12
12
|
const navigatorSpy = vi.spyOn(globalThis, 'navigator', 'get')
|
|
13
13
|
|
|
14
14
|
// Force navigator to be undefined
|
|
15
|
-
|
|
15
|
+
// @ts-expect-error
|
|
16
16
|
navigatorSpy.mockImplementation(() => undefined)
|
|
17
17
|
expect(onlineManager.isOnline()).toBeTruthy()
|
|
18
18
|
|
|
@@ -746,12 +746,15 @@ describe('queryClient', () => {
|
|
|
746
746
|
|
|
747
747
|
test('should stop prefetching if getNextPageParam returns undefined', async () => {
|
|
748
748
|
const key = queryKey()
|
|
749
|
+
let count = 0
|
|
749
750
|
|
|
750
751
|
await queryClient.prefetchInfiniteQuery({
|
|
751
752
|
queryKey: key,
|
|
752
753
|
queryFn: ({ pageParam }) => String(pageParam),
|
|
753
|
-
getNextPageParam: (_lastPage, _pages, lastPageParam) =>
|
|
754
|
-
|
|
754
|
+
getNextPageParam: (_lastPage, _pages, lastPageParam) => {
|
|
755
|
+
count++
|
|
756
|
+
return lastPageParam >= 20 ? undefined : lastPageParam + 5
|
|
757
|
+
},
|
|
755
758
|
initialPageParam: 10,
|
|
756
759
|
pages: 5,
|
|
757
760
|
})
|
|
@@ -762,6 +765,9 @@ describe('queryClient', () => {
|
|
|
762
765
|
pages: ['10', '15', '20'],
|
|
763
766
|
pageParams: [10, 15, 20],
|
|
764
767
|
})
|
|
768
|
+
|
|
769
|
+
// this check ensures we're exiting the fetch loop early
|
|
770
|
+
expect(count).toBe(3)
|
|
765
771
|
})
|
|
766
772
|
})
|
|
767
773
|
|
|
@@ -96,7 +96,7 @@ describe('queryObserver', () => {
|
|
|
96
96
|
|
|
97
97
|
queryClient.invalidateQueries({ queryKey: key, refetchType: 'all' })
|
|
98
98
|
|
|
99
|
-
//So we still expect it to not have fetched and not be fetching
|
|
99
|
+
// So we still expect it to not have fetched and not be fetching
|
|
100
100
|
expect(count).toBe(0)
|
|
101
101
|
expect(observer.getCurrentResult()).toMatchObject({
|
|
102
102
|
status: 'pending',
|
|
@@ -113,7 +113,7 @@ describe('queryObserver', () => {
|
|
|
113
113
|
|
|
114
114
|
expect(enabled).toBe(false)
|
|
115
115
|
|
|
116
|
-
//Not the same with explicit refetch, this will override enabled and trigger a fetch anyway
|
|
116
|
+
// Not the same with explicit refetch, this will override enabled and trigger a fetch anyway
|
|
117
117
|
observer.refetch()
|
|
118
118
|
|
|
119
119
|
expect(observer.getCurrentResult()).toMatchObject({
|
|
@@ -201,18 +201,18 @@ describe('queryObserver', () => {
|
|
|
201
201
|
|
|
202
202
|
queryClient.invalidateQueries({ queryKey: key, refetchType: 'inactive' })
|
|
203
203
|
|
|
204
|
-
//should not refetch since it was active and we only refetch inactive
|
|
204
|
+
// should not refetch since it was active and we only refetch inactive
|
|
205
205
|
await waitFor(() => expect(count).toBe(0))
|
|
206
206
|
|
|
207
207
|
queryClient.invalidateQueries({ queryKey: key, refetchType: 'active' })
|
|
208
208
|
|
|
209
|
-
//should refetch since it was active and we refetch active
|
|
209
|
+
// should refetch since it was active and we refetch active
|
|
210
210
|
await waitFor(() => expect(count).toBe(1))
|
|
211
211
|
|
|
212
212
|
// Toggle enabled
|
|
213
213
|
enabled = false
|
|
214
214
|
|
|
215
|
-
//should not refetch since it is not active and we only refetch active
|
|
215
|
+
// should not refetch since it is not active and we only refetch active
|
|
216
216
|
queryClient.invalidateQueries({ queryKey: key, refetchType: 'active' })
|
|
217
217
|
|
|
218
218
|
await waitFor(() => expect(count).toBe(1))
|
|
@@ -792,7 +792,7 @@ describe('queryObserver', () => {
|
|
|
792
792
|
new QueryObserver(queryClient, {
|
|
793
793
|
queryKey: key,
|
|
794
794
|
queryFn: () => 'data',
|
|
795
|
-
|
|
795
|
+
// @ts-expect-error
|
|
796
796
|
enabled: null,
|
|
797
797
|
}),
|
|
798
798
|
).toThrowError('Expected enabled to be a boolean')
|
|
@@ -947,7 +947,7 @@ describe('queryObserver', () => {
|
|
|
947
947
|
observer.setOptions({
|
|
948
948
|
queryKey: key,
|
|
949
949
|
queryFn: () => data,
|
|
950
|
-
|
|
950
|
+
// @ts-expect-error
|
|
951
951
|
select: () => undefined,
|
|
952
952
|
placeholderData: placeholderData2,
|
|
953
953
|
})
|
package/src/focusManager.ts
CHANGED
|
@@ -17,7 +17,7 @@ export class FocusManager extends Subscribable<Listener> {
|
|
|
17
17
|
super()
|
|
18
18
|
this.#setup = (onFocus) => {
|
|
19
19
|
// addEventListener does not exist in React Native, but window does
|
|
20
|
-
// eslint-disable-next-line
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
21
21
|
if (!isServer && window.addEventListener) {
|
|
22
22
|
const listener = () => onFocus()
|
|
23
23
|
// Listen to visibilitychange
|
|
@@ -78,7 +78,7 @@ export class FocusManager extends Subscribable<Listener> {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// document global can be unavailable in react native
|
|
81
|
-
// eslint-disable-next-line
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
82
82
|
return globalThis.document?.visibilityState !== 'hidden'
|
|
83
83
|
}
|
|
84
84
|
}
|
package/src/hydration.ts
CHANGED
|
@@ -154,9 +154,9 @@ export function hydrate(
|
|
|
154
154
|
client.getDefaultOptions().hydrate?.deserializeData ??
|
|
155
155
|
defaultTransformerFn
|
|
156
156
|
|
|
157
|
-
// eslint-disable-next-line
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
158
158
|
const mutations = (dehydratedState as DehydratedState).mutations || []
|
|
159
|
-
// eslint-disable-next-line
|
|
159
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
160
160
|
const queries = (dehydratedState as DehydratedState).queries || []
|
|
161
161
|
|
|
162
162
|
mutations.forEach(({ state, ...mutationOptions }) => {
|
package/src/index.ts
CHANGED
|
@@ -35,7 +35,8 @@ export {
|
|
|
35
35
|
export * from './types'
|
|
36
36
|
export type { QueryState } from './query'
|
|
37
37
|
export { Query } from './query'
|
|
38
|
-
export type {
|
|
38
|
+
export type { MutationState } from './mutation'
|
|
39
|
+
export { Mutation } from './mutation'
|
|
39
40
|
export type {
|
|
40
41
|
DehydrateOptions,
|
|
41
42
|
DehydratedState,
|
|
@@ -103,6 +103,9 @@ export function infiniteQueryBehavior<TQueryFnData, TError, TData, TPageParam>(
|
|
|
103
103
|
// Fetch remaining pages
|
|
104
104
|
for (let i = 1; i < remainingPages; i++) {
|
|
105
105
|
const param = getNextPageParam(options, result)
|
|
106
|
+
if (param == null) {
|
|
107
|
+
break
|
|
108
|
+
}
|
|
106
109
|
result = await fetchPage(result, param)
|
|
107
110
|
}
|
|
108
111
|
}
|
package/src/onlineManager.ts
CHANGED
|
@@ -14,7 +14,7 @@ export class OnlineManager extends Subscribable<Listener> {
|
|
|
14
14
|
super()
|
|
15
15
|
this.#setup = (onOnline) => {
|
|
16
16
|
// addEventListener does not exist in React Native, but window does
|
|
17
|
-
// eslint-disable-next-line
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
18
18
|
if (!isServer && window.addEventListener) {
|
|
19
19
|
const onlineListener = () => onOnline(true)
|
|
20
20
|
const offlineListener = () => onOnline(false)
|