@tanstack/query-core
Advanced tools
Comparing version 5.62.1 to 5.62.2
@@ -1,3 +0,3 @@ | ||
export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, o as hydrate } from './hydration-OMuWWX9N.js'; | ||
export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, o as hydrate } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
import './subscribable.js'; |
@@ -1,2 +0,2 @@ | ||
export { aY as CancelOptions, C as CancelledError, I as DataTag, z as DefaultError, aX as DefaultOptions, ac as DefaultedInfiniteQueryObserverOptions, aa as DefaultedQueryObserverOptions, aF as DefinedInfiniteQueryObserverResult, ax as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, L as Enabled, af as EnsureInfiniteQueryDataOptions, ae as EnsureQueryDataOptions, ag as FetchInfiniteQueryOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, ad as FetchQueryOptions, aq as FetchStatus, _ as GetNextPageParamFunction, Z as GetPreviousPageParamFunction, H as HydrateOptions, $ as InfiniteData, az as InfiniteQueryObserverBaseResult, aC as InfiniteQueryObserverLoadingErrorResult, aB as InfiniteQueryObserverLoadingResult, ab as InfiniteQueryObserverOptions, aA as InfiniteQueryObserverPendingResult, aD as InfiniteQueryObserverRefetchErrorResult, aG as InfiniteQueryObserverResult, aE as InfiniteQueryObserverSuccessResult, a5 as InfiniteQueryPageParamsOptions, V as InitialDataFunction, a4 as InitialPageParam, al as InvalidateOptions, aj as InvalidateQueryFilters, aP as MutateFunction, aO as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aL as MutationFunction, aH as MutationKey, aK as MutationMeta, e as MutationObserver, aQ as MutationObserverBaseResult, aT as MutationObserverErrorResult, aR as MutationObserverIdleResult, aS as MutationObserverLoadingResult, aN as MutationObserverOptions, aV as MutationObserverResult, aU as MutationObserverSuccessResult, aM as MutationOptions, aJ as MutationScope, v as MutationState, aI as MutationStatus, a1 as NetworkMode, N as NoInfer, a$ as NotifyEvent, a_ as NotifyEventType, a2 as NotifyOnChangeProps, O as OmitKeyof, a9 as Optional, y as Override, W as PlaceholderDataFunction, X as QueriesPlaceholderDataFunction, u as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, aW as QueryClientConfig, j as QueryFilters, J as QueryFunction, T as QueryFunctionContext, A as QueryKey, Y as QueryKeyHashFunction, a0 as QueryMeta, c as QueryObserver, ar as QueryObserverBaseResult, au as QueryObserverLoadingErrorResult, at as QueryObserverLoadingResult, a7 as QueryObserverOptions, as as QueryObserverPendingResult, av as QueryObserverRefetchErrorResult, ay as QueryObserverResult, aw as QueryObserverSuccessResult, a3 as QueryOptions, P as QueryPersister, t as QueryState, ap as QueryStatus, ai as RefetchOptions, ak as RefetchQueryFilters, R as Register, am as ResetOptions, ah as ResultOptions, aZ as SetDataOptions, S as SkipToken, K as StaleTime, a6 as ThrowOnError, G as UnsetMarker, U as Updater, a8 as WithRequired, E as dataTagErrorSymbol, B as dataTagSymbol, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, h as hashKey, o as hydrate, l as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, r as replaceEqualDeep, s as skipToken, F as unsetMarker } from './hydration-OMuWWX9N.js'; | ||
export { aY as CancelOptions, C as CancelledError, I as DataTag, z as DefaultError, aX as DefaultOptions, ac as DefaultedInfiniteQueryObserverOptions, aa as DefaultedQueryObserverOptions, aF as DefinedInfiniteQueryObserverResult, ax as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, L as Enabled, af as EnsureInfiniteQueryDataOptions, ae as EnsureQueryDataOptions, ag as FetchInfiniteQueryOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, ad as FetchQueryOptions, aq as FetchStatus, _ as GetNextPageParamFunction, Z as GetPreviousPageParamFunction, H as HydrateOptions, $ as InfiniteData, az as InfiniteQueryObserverBaseResult, aC as InfiniteQueryObserverLoadingErrorResult, aB as InfiniteQueryObserverLoadingResult, ab as InfiniteQueryObserverOptions, aA as InfiniteQueryObserverPendingResult, aD as InfiniteQueryObserverRefetchErrorResult, aG as InfiniteQueryObserverResult, aE as InfiniteQueryObserverSuccessResult, a5 as InfiniteQueryPageParamsOptions, V as InitialDataFunction, a4 as InitialPageParam, al as InvalidateOptions, aj as InvalidateQueryFilters, aP as MutateFunction, aO as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aL as MutationFunction, aH as MutationKey, aK as MutationMeta, e as MutationObserver, aQ as MutationObserverBaseResult, aT as MutationObserverErrorResult, aR as MutationObserverIdleResult, aS as MutationObserverLoadingResult, aN as MutationObserverOptions, aV as MutationObserverResult, aU as MutationObserverSuccessResult, aM as MutationOptions, aJ as MutationScope, v as MutationState, aI as MutationStatus, a1 as NetworkMode, N as NoInfer, a$ as NotifyEvent, a_ as NotifyEventType, a2 as NotifyOnChangeProps, O as OmitKeyof, a9 as Optional, y as Override, W as PlaceholderDataFunction, X as QueriesPlaceholderDataFunction, u as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, aW as QueryClientConfig, j as QueryFilters, J as QueryFunction, T as QueryFunctionContext, A as QueryKey, Y as QueryKeyHashFunction, a0 as QueryMeta, c as QueryObserver, ar as QueryObserverBaseResult, au as QueryObserverLoadingErrorResult, at as QueryObserverLoadingResult, a7 as QueryObserverOptions, as as QueryObserverPendingResult, av as QueryObserverRefetchErrorResult, ay as QueryObserverResult, aw as QueryObserverSuccessResult, a3 as QueryOptions, P as QueryPersister, t as QueryState, ap as QueryStatus, ai as RefetchOptions, ak as RefetchQueryFilters, R as Register, am as ResetOptions, ah as ResultOptions, aZ as SetDataOptions, S as SkipToken, K as StaleTime, a6 as ThrowOnError, G as UnsetMarker, U as Updater, a8 as WithRequired, E as dataTagErrorSymbol, B as dataTagSymbol, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, h as hashKey, o as hydrate, l as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, r as replaceEqualDeep, s as skipToken, F as unsetMarker } from './hydration-CLZ8NKV0.js'; | ||
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js'; | ||
@@ -3,0 +3,0 @@ export { InfiniteQueryObserver } from './infiniteQueryObserver.js'; |
@@ -1,2 +0,2 @@ | ||
import { b0 as QueryBehavior, $ as InfiniteData, a5 as InfiniteQueryPageParamsOptions } from './hydration-OMuWWX9N.js'; | ||
import { b0 as QueryBehavior, $ as InfiniteData, a5 as InfiniteQueryPageParamsOptions } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
@@ -3,0 +3,0 @@ import './subscribable.js'; |
@@ -1,2 +0,2 @@ | ||
import { z as DefaultError, $ as InfiniteData, A as QueryKey, c as QueryObserver, aG as InfiniteQueryObserverResult, b as QueryClient, ab as InfiniteQueryObserverOptions, b1 as NotifyOptions, ac as DefaultedInfiniteQueryObserverOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, u as Query } from './hydration-OMuWWX9N.js'; | ||
import { z as DefaultError, $ as InfiniteData, A as QueryKey, c as QueryObserver, aG as InfiniteQueryObserverResult, b as QueryClient, ab as InfiniteQueryObserverOptions, b1 as NotifyOptions, ac as DefaultedInfiniteQueryObserverOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, u as Query } from './hydration-CLZ8NKV0.js'; | ||
import { Subscribable } from './subscribable.js'; | ||
@@ -3,0 +3,0 @@ import './removable.js'; |
import './removable.js'; | ||
export { br as Action, w as Mutation, v as MutationState, bs as getDefaultState } from './hydration-OMuWWX9N.js'; | ||
export { br as Action, w as Mutation, v as MutationState, bs as getDefaultState } from './hydration-CLZ8NKV0.js'; | ||
import './subscribable.js'; |
@@ -1,3 +0,3 @@ | ||
export { M as MutationCache, d as MutationCacheNotifyEvent } from './hydration-OMuWWX9N.js'; | ||
export { M as MutationCache, d as MutationCacheNotifyEvent } from './hydration-CLZ8NKV0.js'; | ||
import './subscribable.js'; | ||
import './removable.js'; |
import './subscribable.js'; | ||
export { e as MutationObserver } from './hydration-OMuWWX9N.js'; | ||
export { e as MutationObserver } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; |
@@ -1,2 +0,2 @@ | ||
import { ay as QueryObserverResult, b as QueryClient, a7 as QueryObserverOptions, b1 as NotifyOptions, u as Query, A as QueryKey, c as QueryObserver } from './hydration-OMuWWX9N.js'; | ||
import { ay as QueryObserverResult, b as QueryClient, a7 as QueryObserverOptions, b1 as NotifyOptions, u as Query, A as QueryKey, c as QueryObserver } from './hydration-CLZ8NKV0.js'; | ||
import { Subscribable } from './subscribable.js'; | ||
@@ -3,0 +3,0 @@ import './removable.js'; |
import './removable.js'; | ||
export { b6 as Action, b2 as FetchContext, b3 as FetchDirection, b4 as FetchMeta, b5 as FetchOptions, u as Query, b0 as QueryBehavior, t as QueryState, b7 as SetStateOptions, b8 as fetchState } from './hydration-OMuWWX9N.js'; | ||
export { b6 as Action, b2 as FetchContext, b3 as FetchDirection, b4 as FetchMeta, b5 as FetchOptions, u as Query, b0 as QueryBehavior, t as QueryState, b7 as SetStateOptions, b8 as fetchState } from './hydration-CLZ8NKV0.js'; | ||
import './subscribable.js'; |
@@ -1,3 +0,3 @@ | ||
export { Q as QueryCache, a as QueryCacheNotifyEvent, bq as QueryStore } from './hydration-OMuWWX9N.js'; | ||
export { Q as QueryCache, a as QueryCacheNotifyEvent, bq as QueryStore } from './hydration-CLZ8NKV0.js'; | ||
import './subscribable.js'; | ||
import './removable.js'; |
@@ -1,3 +0,3 @@ | ||
export { b as QueryClient } from './hydration-OMuWWX9N.js'; | ||
export { b as QueryClient } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
import './subscribable.js'; |
@@ -82,5 +82,5 @@ import { | ||
const cachedData = this.getQueryData(options.queryKey); | ||
if (cachedData === void 0) | ||
if (cachedData === void 0) { | ||
return this.fetchQuery(options); | ||
else { | ||
} else { | ||
const defaultedOptions = this.defaultQueryOptions(options); | ||
@@ -148,3 +148,3 @@ const query = __privateGet(this, _queryCache).build(this, defaultedOptions); | ||
} | ||
cancelQueries(filters = {}, cancelOptions = {}) { | ||
cancelQueries(filters, cancelOptions = {}) { | ||
const defaultedCancelOptions = { revert: true, ...cancelOptions }; | ||
@@ -156,3 +156,3 @@ const promises = notifyManager.batch( | ||
} | ||
invalidateQueries(filters = {}, options = {}) { | ||
invalidateQueries(filters, options = {}) { | ||
return notifyManager.batch(() => { | ||
@@ -162,3 +162,3 @@ __privateGet(this, _queryCache).findAll(filters).forEach((query) => { | ||
}); | ||
if (filters.refetchType === "none") { | ||
if ((filters == null ? void 0 : filters.refetchType) === "none") { | ||
return Promise.resolve(); | ||
@@ -168,3 +168,3 @@ } | ||
...filters, | ||
type: filters.refetchType ?? filters.type ?? "active" | ||
type: (filters == null ? void 0 : filters.refetchType) ?? (filters == null ? void 0 : filters.type) ?? "active" | ||
}; | ||
@@ -174,6 +174,6 @@ return this.refetchQueries(refetchFilters, options); | ||
} | ||
refetchQueries(filters = {}, options) { | ||
refetchQueries(filters, options = {}) { | ||
const fetchOptions = { | ||
...options, | ||
cancelRefetch: (options == null ? void 0 : options.cancelRefetch) ?? true | ||
cancelRefetch: options.cancelRefetch ?? true | ||
}; | ||
@@ -241,6 +241,6 @@ const promises = notifyManager.batch( | ||
const defaults = [...__privateGet(this, _queryDefaults).values()]; | ||
let result = {}; | ||
const result = {}; | ||
defaults.forEach((queryDefault) => { | ||
if (partialMatchKey(queryKey, queryDefault.queryKey)) { | ||
result = { ...result, ...queryDefault.defaultOptions }; | ||
Object.assign(result, queryDefault.defaultOptions); | ||
} | ||
@@ -247,0 +247,0 @@ }); |
import './subscribable.js'; | ||
export { b1 as NotifyOptions, c as QueryObserver } from './hydration-OMuWWX9N.js'; | ||
export { b1 as NotifyOptions, c as QueryObserver } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; |
@@ -1,3 +0,3 @@ | ||
export { C as CancelledError, bv as RetryDelayValue, bu as RetryValue, bt as Retryer, bw as canFetch, bx as createRetryer, l as isCancelledError } from './hydration-OMuWWX9N.js'; | ||
export { C as CancelledError, bv as RetryDelayValue, bu as RetryValue, bt as Retryer, bw as canFetch, bx as createRetryer, l as isCancelledError } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
import './subscribable.js'; |
@@ -1,3 +0,3 @@ | ||
export { aY as CancelOptions, I as DataTag, z as DefaultError, aX as DefaultOptions, ac as DefaultedInfiniteQueryObserverOptions, aa as DefaultedQueryObserverOptions, aF as DefinedInfiniteQueryObserverResult, ax as DefinedQueryObserverResult, L as Enabled, af as EnsureInfiniteQueryDataOptions, ae as EnsureQueryDataOptions, ag as FetchInfiniteQueryOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, ad as FetchQueryOptions, aq as FetchStatus, _ as GetNextPageParamFunction, Z as GetPreviousPageParamFunction, $ as InfiniteData, az as InfiniteQueryObserverBaseResult, aC as InfiniteQueryObserverLoadingErrorResult, aB as InfiniteQueryObserverLoadingResult, ab as InfiniteQueryObserverOptions, aA as InfiniteQueryObserverPendingResult, aD as InfiniteQueryObserverRefetchErrorResult, aG as InfiniteQueryObserverResult, aE as InfiniteQueryObserverSuccessResult, a5 as InfiniteQueryPageParamsOptions, V as InitialDataFunction, a4 as InitialPageParam, al as InvalidateOptions, aj as InvalidateQueryFilters, aP as MutateFunction, aO as MutateOptions, aL as MutationFunction, aH as MutationKey, aK as MutationMeta, aQ as MutationObserverBaseResult, aT as MutationObserverErrorResult, aR as MutationObserverIdleResult, aS as MutationObserverLoadingResult, aN as MutationObserverOptions, aV as MutationObserverResult, aU as MutationObserverSuccessResult, aM as MutationOptions, aJ as MutationScope, aI as MutationStatus, a1 as NetworkMode, N as NoInfer, a$ as NotifyEvent, a_ as NotifyEventType, a2 as NotifyOnChangeProps, O as OmitKeyof, a9 as Optional, y as Override, W as PlaceholderDataFunction, X as QueriesPlaceholderDataFunction, aW as QueryClientConfig, J as QueryFunction, T as QueryFunctionContext, A as QueryKey, Y as QueryKeyHashFunction, a0 as QueryMeta, ar as QueryObserverBaseResult, au as QueryObserverLoadingErrorResult, at as QueryObserverLoadingResult, a7 as QueryObserverOptions, as as QueryObserverPendingResult, av as QueryObserverRefetchErrorResult, ay as QueryObserverResult, aw as QueryObserverSuccessResult, a3 as QueryOptions, P as QueryPersister, ap as QueryStatus, ai as RefetchOptions, ak as RefetchQueryFilters, R as Register, am as ResetOptions, ah as ResultOptions, aZ as SetDataOptions, K as StaleTime, a6 as ThrowOnError, G as UnsetMarker, a8 as WithRequired, E as dataTagErrorSymbol, B as dataTagSymbol, F as unsetMarker } from './hydration-OMuWWX9N.js'; | ||
export { aY as CancelOptions, I as DataTag, z as DefaultError, aX as DefaultOptions, ac as DefaultedInfiniteQueryObserverOptions, aa as DefaultedQueryObserverOptions, aF as DefinedInfiniteQueryObserverResult, ax as DefinedQueryObserverResult, L as Enabled, af as EnsureInfiniteQueryDataOptions, ae as EnsureQueryDataOptions, ag as FetchInfiniteQueryOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, ad as FetchQueryOptions, aq as FetchStatus, _ as GetNextPageParamFunction, Z as GetPreviousPageParamFunction, $ as InfiniteData, az as InfiniteQueryObserverBaseResult, aC as InfiniteQueryObserverLoadingErrorResult, aB as InfiniteQueryObserverLoadingResult, ab as InfiniteQueryObserverOptions, aA as InfiniteQueryObserverPendingResult, aD as InfiniteQueryObserverRefetchErrorResult, aG as InfiniteQueryObserverResult, aE as InfiniteQueryObserverSuccessResult, a5 as InfiniteQueryPageParamsOptions, V as InitialDataFunction, a4 as InitialPageParam, al as InvalidateOptions, aj as InvalidateQueryFilters, aP as MutateFunction, aO as MutateOptions, aL as MutationFunction, aH as MutationKey, aK as MutationMeta, aQ as MutationObserverBaseResult, aT as MutationObserverErrorResult, aR as MutationObserverIdleResult, aS as MutationObserverLoadingResult, aN as MutationObserverOptions, aV as MutationObserverResult, aU as MutationObserverSuccessResult, aM as MutationOptions, aJ as MutationScope, aI as MutationStatus, a1 as NetworkMode, N as NoInfer, a$ as NotifyEvent, a_ as NotifyEventType, a2 as NotifyOnChangeProps, O as OmitKeyof, a9 as Optional, y as Override, W as PlaceholderDataFunction, X as QueriesPlaceholderDataFunction, aW as QueryClientConfig, J as QueryFunction, T as QueryFunctionContext, A as QueryKey, Y as QueryKeyHashFunction, a0 as QueryMeta, ar as QueryObserverBaseResult, au as QueryObserverLoadingErrorResult, at as QueryObserverLoadingResult, a7 as QueryObserverOptions, as as QueryObserverPendingResult, av as QueryObserverRefetchErrorResult, ay as QueryObserverResult, aw as QueryObserverSuccessResult, a3 as QueryOptions, P as QueryPersister, ap as QueryStatus, ai as RefetchOptions, ak as RefetchQueryFilters, R as Register, am as ResetOptions, ah as ResultOptions, aZ as SetDataOptions, K as StaleTime, a6 as ThrowOnError, G as UnsetMarker, a8 as WithRequired, E as dataTagErrorSymbol, B as dataTagSymbol, F as unsetMarker } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
import './subscribable.js'; |
@@ -1,3 +0,3 @@ | ||
export { g as MutationFilters, j as QueryFilters, b9 as QueryTypeFilter, S as SkipToken, U as Updater, bn as addToEnd, bo as addToStart, bp as ensureQueryFn, bb as functionalUpdate, h as hashKey, bg as hashQueryKeyByOptions, bj as isPlainArray, bk as isPlainObject, i as isServer, bc as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, ba as noop, bh as partialMatchKey, bm as replaceData, r as replaceEqualDeep, bf as resolveEnabled, be as resolveStaleTime, bi as shallowEqualObjects, s as skipToken, bl as sleep, bd as timeUntilStale } from './hydration-OMuWWX9N.js'; | ||
export { g as MutationFilters, j as QueryFilters, b9 as QueryTypeFilter, S as SkipToken, U as Updater, bn as addToEnd, bo as addToStart, bp as ensureQueryFn, bb as functionalUpdate, h as hashKey, bg as hashQueryKeyByOptions, bj as isPlainArray, bk as isPlainObject, i as isServer, bc as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, ba as noop, bh as partialMatchKey, bm as replaceData, r as replaceEqualDeep, bf as resolveEnabled, be as resolveStaleTime, bi as shallowEqualObjects, s as skipToken, bl as sleep, bd as timeUntilStale } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
import './subscribable.js'; |
@@ -1,3 +0,3 @@ | ||
export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, o as hydrate } from './hydration-OMuWWX9N.js'; | ||
export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, o as hydrate } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
import './subscribable.js'; |
@@ -1,2 +0,2 @@ | ||
export { aY as CancelOptions, C as CancelledError, I as DataTag, z as DefaultError, aX as DefaultOptions, ac as DefaultedInfiniteQueryObserverOptions, aa as DefaultedQueryObserverOptions, aF as DefinedInfiniteQueryObserverResult, ax as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, L as Enabled, af as EnsureInfiniteQueryDataOptions, ae as EnsureQueryDataOptions, ag as FetchInfiniteQueryOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, ad as FetchQueryOptions, aq as FetchStatus, _ as GetNextPageParamFunction, Z as GetPreviousPageParamFunction, H as HydrateOptions, $ as InfiniteData, az as InfiniteQueryObserverBaseResult, aC as InfiniteQueryObserverLoadingErrorResult, aB as InfiniteQueryObserverLoadingResult, ab as InfiniteQueryObserverOptions, aA as InfiniteQueryObserverPendingResult, aD as InfiniteQueryObserverRefetchErrorResult, aG as InfiniteQueryObserverResult, aE as InfiniteQueryObserverSuccessResult, a5 as InfiniteQueryPageParamsOptions, V as InitialDataFunction, a4 as InitialPageParam, al as InvalidateOptions, aj as InvalidateQueryFilters, aP as MutateFunction, aO as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aL as MutationFunction, aH as MutationKey, aK as MutationMeta, e as MutationObserver, aQ as MutationObserverBaseResult, aT as MutationObserverErrorResult, aR as MutationObserverIdleResult, aS as MutationObserverLoadingResult, aN as MutationObserverOptions, aV as MutationObserverResult, aU as MutationObserverSuccessResult, aM as MutationOptions, aJ as MutationScope, v as MutationState, aI as MutationStatus, a1 as NetworkMode, N as NoInfer, a$ as NotifyEvent, a_ as NotifyEventType, a2 as NotifyOnChangeProps, O as OmitKeyof, a9 as Optional, y as Override, W as PlaceholderDataFunction, X as QueriesPlaceholderDataFunction, u as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, aW as QueryClientConfig, j as QueryFilters, J as QueryFunction, T as QueryFunctionContext, A as QueryKey, Y as QueryKeyHashFunction, a0 as QueryMeta, c as QueryObserver, ar as QueryObserverBaseResult, au as QueryObserverLoadingErrorResult, at as QueryObserverLoadingResult, a7 as QueryObserverOptions, as as QueryObserverPendingResult, av as QueryObserverRefetchErrorResult, ay as QueryObserverResult, aw as QueryObserverSuccessResult, a3 as QueryOptions, P as QueryPersister, t as QueryState, ap as QueryStatus, ai as RefetchOptions, ak as RefetchQueryFilters, R as Register, am as ResetOptions, ah as ResultOptions, aZ as SetDataOptions, S as SkipToken, K as StaleTime, a6 as ThrowOnError, G as UnsetMarker, U as Updater, a8 as WithRequired, E as dataTagErrorSymbol, B as dataTagSymbol, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, h as hashKey, o as hydrate, l as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, r as replaceEqualDeep, s as skipToken, F as unsetMarker } from './hydration-OMuWWX9N.js'; | ||
export { aY as CancelOptions, C as CancelledError, I as DataTag, z as DefaultError, aX as DefaultOptions, ac as DefaultedInfiniteQueryObserverOptions, aa as DefaultedQueryObserverOptions, aF as DefinedInfiniteQueryObserverResult, ax as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, L as Enabled, af as EnsureInfiniteQueryDataOptions, ae as EnsureQueryDataOptions, ag as FetchInfiniteQueryOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, ad as FetchQueryOptions, aq as FetchStatus, _ as GetNextPageParamFunction, Z as GetPreviousPageParamFunction, H as HydrateOptions, $ as InfiniteData, az as InfiniteQueryObserverBaseResult, aC as InfiniteQueryObserverLoadingErrorResult, aB as InfiniteQueryObserverLoadingResult, ab as InfiniteQueryObserverOptions, aA as InfiniteQueryObserverPendingResult, aD as InfiniteQueryObserverRefetchErrorResult, aG as InfiniteQueryObserverResult, aE as InfiniteQueryObserverSuccessResult, a5 as InfiniteQueryPageParamsOptions, V as InitialDataFunction, a4 as InitialPageParam, al as InvalidateOptions, aj as InvalidateQueryFilters, aP as MutateFunction, aO as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aL as MutationFunction, aH as MutationKey, aK as MutationMeta, e as MutationObserver, aQ as MutationObserverBaseResult, aT as MutationObserverErrorResult, aR as MutationObserverIdleResult, aS as MutationObserverLoadingResult, aN as MutationObserverOptions, aV as MutationObserverResult, aU as MutationObserverSuccessResult, aM as MutationOptions, aJ as MutationScope, v as MutationState, aI as MutationStatus, a1 as NetworkMode, N as NoInfer, a$ as NotifyEvent, a_ as NotifyEventType, a2 as NotifyOnChangeProps, O as OmitKeyof, a9 as Optional, y as Override, W as PlaceholderDataFunction, X as QueriesPlaceholderDataFunction, u as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, aW as QueryClientConfig, j as QueryFilters, J as QueryFunction, T as QueryFunctionContext, A as QueryKey, Y as QueryKeyHashFunction, a0 as QueryMeta, c as QueryObserver, ar as QueryObserverBaseResult, au as QueryObserverLoadingErrorResult, at as QueryObserverLoadingResult, a7 as QueryObserverOptions, as as QueryObserverPendingResult, av as QueryObserverRefetchErrorResult, ay as QueryObserverResult, aw as QueryObserverSuccessResult, a3 as QueryOptions, P as QueryPersister, t as QueryState, ap as QueryStatus, ai as RefetchOptions, ak as RefetchQueryFilters, R as Register, am as ResetOptions, ah as ResultOptions, aZ as SetDataOptions, S as SkipToken, K as StaleTime, a6 as ThrowOnError, G as UnsetMarker, U as Updater, a8 as WithRequired, E as dataTagErrorSymbol, B as dataTagSymbol, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, h as hashKey, o as hydrate, l as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, r as replaceEqualDeep, s as skipToken, F as unsetMarker } from './hydration-CLZ8NKV0.js'; | ||
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js'; | ||
@@ -3,0 +3,0 @@ export { InfiniteQueryObserver } from './infiniteQueryObserver.js'; |
@@ -1,2 +0,2 @@ | ||
import { b0 as QueryBehavior, $ as InfiniteData, a5 as InfiniteQueryPageParamsOptions } from './hydration-OMuWWX9N.js'; | ||
import { b0 as QueryBehavior, $ as InfiniteData, a5 as InfiniteQueryPageParamsOptions } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
@@ -3,0 +3,0 @@ import './subscribable.js'; |
@@ -1,2 +0,2 @@ | ||
import { z as DefaultError, $ as InfiniteData, A as QueryKey, c as QueryObserver, aG as InfiniteQueryObserverResult, b as QueryClient, ab as InfiniteQueryObserverOptions, b1 as NotifyOptions, ac as DefaultedInfiniteQueryObserverOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, u as Query } from './hydration-OMuWWX9N.js'; | ||
import { z as DefaultError, $ as InfiniteData, A as QueryKey, c as QueryObserver, aG as InfiniteQueryObserverResult, b as QueryClient, ab as InfiniteQueryObserverOptions, b1 as NotifyOptions, ac as DefaultedInfiniteQueryObserverOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, u as Query } from './hydration-CLZ8NKV0.js'; | ||
import { Subscribable } from './subscribable.js'; | ||
@@ -3,0 +3,0 @@ import './removable.js'; |
import './removable.js'; | ||
export { br as Action, w as Mutation, v as MutationState, bs as getDefaultState } from './hydration-OMuWWX9N.js'; | ||
export { br as Action, w as Mutation, v as MutationState, bs as getDefaultState } from './hydration-CLZ8NKV0.js'; | ||
import './subscribable.js'; |
@@ -1,3 +0,3 @@ | ||
export { M as MutationCache, d as MutationCacheNotifyEvent } from './hydration-OMuWWX9N.js'; | ||
export { M as MutationCache, d as MutationCacheNotifyEvent } from './hydration-CLZ8NKV0.js'; | ||
import './subscribable.js'; | ||
import './removable.js'; |
import './subscribable.js'; | ||
export { e as MutationObserver } from './hydration-OMuWWX9N.js'; | ||
export { e as MutationObserver } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; |
@@ -1,2 +0,2 @@ | ||
import { ay as QueryObserverResult, b as QueryClient, a7 as QueryObserverOptions, b1 as NotifyOptions, u as Query, A as QueryKey, c as QueryObserver } from './hydration-OMuWWX9N.js'; | ||
import { ay as QueryObserverResult, b as QueryClient, a7 as QueryObserverOptions, b1 as NotifyOptions, u as Query, A as QueryKey, c as QueryObserver } from './hydration-CLZ8NKV0.js'; | ||
import { Subscribable } from './subscribable.js'; | ||
@@ -3,0 +3,0 @@ import './removable.js'; |
import './removable.js'; | ||
export { b6 as Action, b2 as FetchContext, b3 as FetchDirection, b4 as FetchMeta, b5 as FetchOptions, u as Query, b0 as QueryBehavior, t as QueryState, b7 as SetStateOptions, b8 as fetchState } from './hydration-OMuWWX9N.js'; | ||
export { b6 as Action, b2 as FetchContext, b3 as FetchDirection, b4 as FetchMeta, b5 as FetchOptions, u as Query, b0 as QueryBehavior, t as QueryState, b7 as SetStateOptions, b8 as fetchState } from './hydration-CLZ8NKV0.js'; | ||
import './subscribable.js'; |
@@ -1,3 +0,3 @@ | ||
export { Q as QueryCache, a as QueryCacheNotifyEvent, bq as QueryStore } from './hydration-OMuWWX9N.js'; | ||
export { Q as QueryCache, a as QueryCacheNotifyEvent, bq as QueryStore } from './hydration-CLZ8NKV0.js'; | ||
import './subscribable.js'; | ||
import './removable.js'; |
@@ -1,3 +0,3 @@ | ||
export { b as QueryClient } from './hydration-OMuWWX9N.js'; | ||
export { b as QueryClient } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
import './subscribable.js'; |
@@ -72,5 +72,5 @@ // src/queryClient.ts | ||
const cachedData = this.getQueryData(options.queryKey); | ||
if (cachedData === void 0) | ||
if (cachedData === void 0) { | ||
return this.fetchQuery(options); | ||
else { | ||
} else { | ||
const defaultedOptions = this.defaultQueryOptions(options); | ||
@@ -137,3 +137,3 @@ const query = this.#queryCache.build(this, defaultedOptions); | ||
} | ||
cancelQueries(filters = {}, cancelOptions = {}) { | ||
cancelQueries(filters, cancelOptions = {}) { | ||
const defaultedCancelOptions = { revert: true, ...cancelOptions }; | ||
@@ -145,3 +145,3 @@ const promises = notifyManager.batch( | ||
} | ||
invalidateQueries(filters = {}, options = {}) { | ||
invalidateQueries(filters, options = {}) { | ||
return notifyManager.batch(() => { | ||
@@ -151,3 +151,3 @@ this.#queryCache.findAll(filters).forEach((query) => { | ||
}); | ||
if (filters.refetchType === "none") { | ||
if (filters?.refetchType === "none") { | ||
return Promise.resolve(); | ||
@@ -157,3 +157,3 @@ } | ||
...filters, | ||
type: filters.refetchType ?? filters.type ?? "active" | ||
type: filters?.refetchType ?? filters?.type ?? "active" | ||
}; | ||
@@ -163,6 +163,6 @@ return this.refetchQueries(refetchFilters, options); | ||
} | ||
refetchQueries(filters = {}, options) { | ||
refetchQueries(filters, options = {}) { | ||
const fetchOptions = { | ||
...options, | ||
cancelRefetch: options?.cancelRefetch ?? true | ||
cancelRefetch: options.cancelRefetch ?? true | ||
}; | ||
@@ -230,6 +230,6 @@ const promises = notifyManager.batch( | ||
const defaults = [...this.#queryDefaults.values()]; | ||
let result = {}; | ||
const result = {}; | ||
defaults.forEach((queryDefault) => { | ||
if (partialMatchKey(queryKey, queryDefault.queryKey)) { | ||
result = { ...result, ...queryDefault.defaultOptions }; | ||
Object.assign(result, queryDefault.defaultOptions); | ||
} | ||
@@ -236,0 +236,0 @@ }); |
import './subscribable.js'; | ||
export { b1 as NotifyOptions, c as QueryObserver } from './hydration-OMuWWX9N.js'; | ||
export { b1 as NotifyOptions, c as QueryObserver } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; |
@@ -1,3 +0,3 @@ | ||
export { C as CancelledError, bv as RetryDelayValue, bu as RetryValue, bt as Retryer, bw as canFetch, bx as createRetryer, l as isCancelledError } from './hydration-OMuWWX9N.js'; | ||
export { C as CancelledError, bv as RetryDelayValue, bu as RetryValue, bt as Retryer, bw as canFetch, bx as createRetryer, l as isCancelledError } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
import './subscribable.js'; |
@@ -1,3 +0,3 @@ | ||
export { aY as CancelOptions, I as DataTag, z as DefaultError, aX as DefaultOptions, ac as DefaultedInfiniteQueryObserverOptions, aa as DefaultedQueryObserverOptions, aF as DefinedInfiniteQueryObserverResult, ax as DefinedQueryObserverResult, L as Enabled, af as EnsureInfiniteQueryDataOptions, ae as EnsureQueryDataOptions, ag as FetchInfiniteQueryOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, ad as FetchQueryOptions, aq as FetchStatus, _ as GetNextPageParamFunction, Z as GetPreviousPageParamFunction, $ as InfiniteData, az as InfiniteQueryObserverBaseResult, aC as InfiniteQueryObserverLoadingErrorResult, aB as InfiniteQueryObserverLoadingResult, ab as InfiniteQueryObserverOptions, aA as InfiniteQueryObserverPendingResult, aD as InfiniteQueryObserverRefetchErrorResult, aG as InfiniteQueryObserverResult, aE as InfiniteQueryObserverSuccessResult, a5 as InfiniteQueryPageParamsOptions, V as InitialDataFunction, a4 as InitialPageParam, al as InvalidateOptions, aj as InvalidateQueryFilters, aP as MutateFunction, aO as MutateOptions, aL as MutationFunction, aH as MutationKey, aK as MutationMeta, aQ as MutationObserverBaseResult, aT as MutationObserverErrorResult, aR as MutationObserverIdleResult, aS as MutationObserverLoadingResult, aN as MutationObserverOptions, aV as MutationObserverResult, aU as MutationObserverSuccessResult, aM as MutationOptions, aJ as MutationScope, aI as MutationStatus, a1 as NetworkMode, N as NoInfer, a$ as NotifyEvent, a_ as NotifyEventType, a2 as NotifyOnChangeProps, O as OmitKeyof, a9 as Optional, y as Override, W as PlaceholderDataFunction, X as QueriesPlaceholderDataFunction, aW as QueryClientConfig, J as QueryFunction, T as QueryFunctionContext, A as QueryKey, Y as QueryKeyHashFunction, a0 as QueryMeta, ar as QueryObserverBaseResult, au as QueryObserverLoadingErrorResult, at as QueryObserverLoadingResult, a7 as QueryObserverOptions, as as QueryObserverPendingResult, av as QueryObserverRefetchErrorResult, ay as QueryObserverResult, aw as QueryObserverSuccessResult, a3 as QueryOptions, P as QueryPersister, ap as QueryStatus, ai as RefetchOptions, ak as RefetchQueryFilters, R as Register, am as ResetOptions, ah as ResultOptions, aZ as SetDataOptions, K as StaleTime, a6 as ThrowOnError, G as UnsetMarker, a8 as WithRequired, E as dataTagErrorSymbol, B as dataTagSymbol, F as unsetMarker } from './hydration-OMuWWX9N.js'; | ||
export { aY as CancelOptions, I as DataTag, z as DefaultError, aX as DefaultOptions, ac as DefaultedInfiniteQueryObserverOptions, aa as DefaultedQueryObserverOptions, aF as DefinedInfiniteQueryObserverResult, ax as DefinedQueryObserverResult, L as Enabled, af as EnsureInfiniteQueryDataOptions, ae as EnsureQueryDataOptions, ag as FetchInfiniteQueryOptions, an as FetchNextPageOptions, ao as FetchPreviousPageOptions, ad as FetchQueryOptions, aq as FetchStatus, _ as GetNextPageParamFunction, Z as GetPreviousPageParamFunction, $ as InfiniteData, az as InfiniteQueryObserverBaseResult, aC as InfiniteQueryObserverLoadingErrorResult, aB as InfiniteQueryObserverLoadingResult, ab as InfiniteQueryObserverOptions, aA as InfiniteQueryObserverPendingResult, aD as InfiniteQueryObserverRefetchErrorResult, aG as InfiniteQueryObserverResult, aE as InfiniteQueryObserverSuccessResult, a5 as InfiniteQueryPageParamsOptions, V as InitialDataFunction, a4 as InitialPageParam, al as InvalidateOptions, aj as InvalidateQueryFilters, aP as MutateFunction, aO as MutateOptions, aL as MutationFunction, aH as MutationKey, aK as MutationMeta, aQ as MutationObserverBaseResult, aT as MutationObserverErrorResult, aR as MutationObserverIdleResult, aS as MutationObserverLoadingResult, aN as MutationObserverOptions, aV as MutationObserverResult, aU as MutationObserverSuccessResult, aM as MutationOptions, aJ as MutationScope, aI as MutationStatus, a1 as NetworkMode, N as NoInfer, a$ as NotifyEvent, a_ as NotifyEventType, a2 as NotifyOnChangeProps, O as OmitKeyof, a9 as Optional, y as Override, W as PlaceholderDataFunction, X as QueriesPlaceholderDataFunction, aW as QueryClientConfig, J as QueryFunction, T as QueryFunctionContext, A as QueryKey, Y as QueryKeyHashFunction, a0 as QueryMeta, ar as QueryObserverBaseResult, au as QueryObserverLoadingErrorResult, at as QueryObserverLoadingResult, a7 as QueryObserverOptions, as as QueryObserverPendingResult, av as QueryObserverRefetchErrorResult, ay as QueryObserverResult, aw as QueryObserverSuccessResult, a3 as QueryOptions, P as QueryPersister, ap as QueryStatus, ai as RefetchOptions, ak as RefetchQueryFilters, R as Register, am as ResetOptions, ah as ResultOptions, aZ as SetDataOptions, K as StaleTime, a6 as ThrowOnError, G as UnsetMarker, a8 as WithRequired, E as dataTagErrorSymbol, B as dataTagSymbol, F as unsetMarker } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
import './subscribable.js'; |
@@ -1,3 +0,3 @@ | ||
export { g as MutationFilters, j as QueryFilters, b9 as QueryTypeFilter, S as SkipToken, U as Updater, bn as addToEnd, bo as addToStart, bp as ensureQueryFn, bb as functionalUpdate, h as hashKey, bg as hashQueryKeyByOptions, bj as isPlainArray, bk as isPlainObject, i as isServer, bc as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, ba as noop, bh as partialMatchKey, bm as replaceData, r as replaceEqualDeep, bf as resolveEnabled, be as resolveStaleTime, bi as shallowEqualObjects, s as skipToken, bl as sleep, bd as timeUntilStale } from './hydration-OMuWWX9N.js'; | ||
export { g as MutationFilters, j as QueryFilters, b9 as QueryTypeFilter, S as SkipToken, U as Updater, bn as addToEnd, bo as addToStart, bp as ensureQueryFn, bb as functionalUpdate, h as hashKey, bg as hashQueryKeyByOptions, bj as isPlainArray, bk as isPlainObject, i as isServer, bc as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, ba as noop, bh as partialMatchKey, bm as replaceData, r as replaceEqualDeep, bf as resolveEnabled, be as resolveStaleTime, bi as shallowEqualObjects, s as skipToken, bl as sleep, bd as timeUntilStale } from './hydration-CLZ8NKV0.js'; | ||
import './removable.js'; | ||
import './subscribable.js'; |
{ | ||
"name": "@tanstack/query-core", | ||
"version": "5.62.1", | ||
"version": "5.62.2", | ||
"description": "The framework agnostic core that powers TanStack Query", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
@@ -109,3 +109,5 @@ import { | ||
isFetching(filters?: QueryFilters): number { | ||
isFetching< | ||
TQueryFilters extends QueryFilters<any, any, any, any> = QueryFilters, | ||
>(filters?: TQueryFilters): number { | ||
return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' }) | ||
@@ -115,3 +117,5 @@ .length | ||
isMutating(filters?: MutationFilters): number { | ||
isMutating< | ||
TMutationFilters extends MutationFilters<any, any> = MutationFilters, | ||
>(filters?: TMutationFilters): number { | ||
return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length | ||
@@ -130,6 +134,8 @@ } | ||
: TQueryFnData, | ||
>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined | ||
getQueryData(queryKey: QueryKey) { | ||
>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined { | ||
const options = this.defaultQueryOptions({ queryKey }) | ||
return this.#queryCache.get(options.queryHash)?.state.data | ||
return this.#queryCache.get(options.queryHash)?.state.data as | ||
| TInferredQueryFnData | ||
| undefined | ||
} | ||
@@ -147,4 +153,5 @@ | ||
if (cachedData === undefined) return this.fetchQuery(options) | ||
else { | ||
if (cachedData === undefined) { | ||
return this.fetchQuery(options) | ||
} else { | ||
const defaultedOptions = this.defaultQueryOptions(options) | ||
@@ -164,7 +171,23 @@ const query = this.#queryCache.build(this, defaultedOptions) | ||
getQueriesData<TQueryFnData = unknown>( | ||
filters: QueryFilters, | ||
): Array<[QueryKey, TQueryFnData | undefined]> { | ||
getQueriesData< | ||
TQueryFnData = unknown, | ||
TQueryFilters extends QueryFilters< | ||
any, | ||
any, | ||
any, | ||
any | ||
> = QueryFilters<TQueryFnData>, | ||
TInferredQueryFnData = TQueryFilters extends QueryFilters< | ||
infer TData, | ||
any, | ||
any, | ||
any | ||
> | ||
? TData | ||
: TQueryFnData, | ||
>( | ||
filters: TQueryFilters, | ||
): Array<[QueryKey, TInferredQueryFnData | undefined]> { | ||
return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { | ||
const data = state.data as TQueryFnData | undefined | ||
const data = state.data as TInferredQueryFnData | undefined | ||
return [queryKey, data] | ||
@@ -215,7 +238,26 @@ }) | ||
setQueriesData<TQueryFnData>( | ||
filters: QueryFilters, | ||
updater: Updater<TQueryFnData | undefined, TQueryFnData | undefined>, | ||
setQueriesData< | ||
TQueryFnData, | ||
TQueryFilters extends QueryFilters< | ||
any, | ||
any, | ||
any, | ||
any | ||
> = QueryFilters<TQueryFnData>, | ||
TInferredQueryFnData = TQueryFilters extends QueryFilters< | ||
infer TData, | ||
any, | ||
any, | ||
any | ||
> | ||
? TData | ||
: TQueryFnData, | ||
>( | ||
filters: TQueryFilters, | ||
updater: Updater< | ||
NoInfer<TInferredQueryFnData> | undefined, | ||
NoInfer<TInferredQueryFnData> | undefined | ||
>, | ||
options?: SetDataOptions, | ||
): Array<[QueryKey, TQueryFnData | undefined]> { | ||
): Array<[QueryKey, TInferredQueryFnData | undefined]> { | ||
return notifyManager.batch(() => | ||
@@ -226,3 +268,3 @@ this.#queryCache | ||
queryKey, | ||
this.setQueryData<TQueryFnData>(queryKey, updater, options), | ||
this.setQueryData<TInferredQueryFnData>(queryKey, updater, options), | ||
]), | ||
@@ -261,3 +303,5 @@ ) | ||
removeQueries(filters?: QueryFilters): void { | ||
removeQueries< | ||
TQueryFilters extends QueryFilters<any, any, any, any> = QueryFilters, | ||
>(filters?: TQueryFilters): void { | ||
const queryCache = this.#queryCache | ||
@@ -271,3 +315,5 @@ notifyManager.batch(() => { | ||
resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise<void> { | ||
resetQueries< | ||
TQueryFilters extends QueryFilters<any, any, any, any> = QueryFilters, | ||
>(filters?: TQueryFilters, options?: ResetOptions): Promise<void> { | ||
const queryCache = this.#queryCache | ||
@@ -288,6 +334,5 @@ | ||
cancelQueries( | ||
filters: QueryFilters = {}, | ||
cancelOptions: CancelOptions = {}, | ||
): Promise<void> { | ||
cancelQueries< | ||
TQueryFilters extends QueryFilters<any, any, any, any> = QueryFilters, | ||
>(filters?: TQueryFilters, cancelOptions: CancelOptions = {}): Promise<void> { | ||
const defaultedCancelOptions = { revert: true, ...cancelOptions } | ||
@@ -304,4 +349,11 @@ | ||
invalidateQueries( | ||
filters: InvalidateQueryFilters = {}, | ||
invalidateQueries< | ||
TInvalidateQueryFilters extends InvalidateQueryFilters< | ||
any, | ||
any, | ||
any, | ||
any | ||
> = InvalidateQueryFilters, | ||
>( | ||
filters?: TInvalidateQueryFilters, | ||
options: InvalidateOptions = {}, | ||
@@ -314,3 +366,3 @@ ): Promise<void> { | ||
if (filters.refetchType === 'none') { | ||
if (filters?.refetchType === 'none') { | ||
return Promise.resolve() | ||
@@ -320,3 +372,3 @@ } | ||
...filters, | ||
type: filters.refetchType ?? filters.type ?? 'active', | ||
type: filters?.refetchType ?? filters?.type ?? 'active', | ||
} | ||
@@ -327,9 +379,16 @@ return this.refetchQueries(refetchFilters, options) | ||
refetchQueries( | ||
filters: RefetchQueryFilters = {}, | ||
options?: RefetchOptions, | ||
refetchQueries< | ||
TRefetchQueryFilters extends RefetchQueryFilters< | ||
any, | ||
any, | ||
any, | ||
any | ||
> = RefetchQueryFilters, | ||
>( | ||
filters?: TRefetchQueryFilters, | ||
options: RefetchOptions = {}, | ||
): Promise<void> { | ||
const fetchOptions = { | ||
...options, | ||
cancelRefetch: options?.cancelRefetch ?? true, | ||
cancelRefetch: options.cancelRefetch ?? true, | ||
} | ||
@@ -511,3 +570,3 @@ const promises = notifyManager.batch(() => | ||
let result: OmitKeyof< | ||
const result: OmitKeyof< | ||
QueryObserverOptions<any, any, any, any, any>, | ||
@@ -519,3 +578,3 @@ 'queryKey' | ||
if (partialMatchKey(queryKey, queryDefault.queryKey)) { | ||
result = { ...result, ...queryDefault.defaultOptions } | ||
Object.assign(result, queryDefault.defaultOptions) | ||
} | ||
@@ -522,0 +581,0 @@ }) |
import type { | ||
DataTag, | ||
DefaultError, | ||
@@ -39,5 +38,3 @@ Enabled, | ||
*/ | ||
queryKey?: unknown extends TQueryFnData | ||
? QueryKey | ||
: QueryKey & DataTag<unknown, TQueryFnData, TError> | ||
queryKey?: TQueryKey | ||
/** | ||
@@ -53,3 +50,8 @@ * Include or exclude stale queries | ||
export interface MutationFilters { | ||
export interface MutationFilters< | ||
TData = unknown, | ||
TError = DefaultError, | ||
TVariables = unknown, | ||
TContext = unknown, | ||
> { | ||
/** | ||
@@ -62,3 +64,5 @@ * Match mutation key exactly | ||
*/ | ||
predicate?: (mutation: Mutation<any, any, any>) => boolean | ||
predicate?: ( | ||
mutation: Mutation<TData, TError, TVariables, TContext>, | ||
) => boolean | ||
/** | ||
@@ -65,0 +69,0 @@ * Include mutations matching this mutation key |
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
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
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
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
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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1852850
22183