@tanstack/query-core 5.35.1 → 5.35.5
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.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-MRM6XQm8.d.ts → types-Br-AgPmc.d.ts} +152 -2
- package/build/legacy/{types-bm8APd3J.d.cts → types-Ya7vXgfL.d.cts} +152 -2
- 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.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-MRM6XQm8.d.ts → types-Br-AgPmc.d.ts} +152 -2
- package/build/modern/{types-bm8APd3J.d.cts → types-Ya7vXgfL.d.cts} +152 -2
- 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/__tests__/queryClient.test-d.tsx +1 -2
- package/src/types.ts +152 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as Mutation, o as Query, K as QueryOptions, ay as MutationOptions, b as QueryClient, at as MutationKey, q as MutationState, aw as MutationMeta, av as MutationScope, t as QueryKey, n as QueryState, F as QueryMeta } from './types-
|
|
1
|
+
import { p as Mutation, o as Query, K as QueryOptions, ay as MutationOptions, b as QueryClient, at as MutationKey, q as MutationState, aw as MutationMeta, av as MutationScope, t as QueryKey, n as QueryState, F as QueryMeta } from './types-Ya7vXgfL.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as Mutation, o as Query, K as QueryOptions, ay as MutationOptions, b as QueryClient, at as MutationKey, q as MutationState, aw as MutationMeta, av as MutationScope, t as QueryKey, n as QueryState, F as QueryMeta } from './types-
|
|
1
|
+
import { p as Mutation, o as Query, K as QueryOptions, ay as MutationOptions, b as QueryClient, at as MutationKey, q as MutationState, aw as MutationMeta, av as MutationScope, t as QueryKey, n as QueryState, F as QueryMeta } from './types-Br-AgPmc.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
4
4
|
|
package/build/legacy/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aK as CancelOptions, C as CancelledError, v as DataTag, D as DefaultError, aJ as DefaultOptions, $ as DefaultedInfiniteQueryObserverOptions, Z as DefaultedQueryObserverOptions, ar as DefinedInfiniteQueryObserverResult, aj as DefinedQueryObserverResult, a1 as EnsureQueryDataOptions, a2 as FetchInfiniteQueryOptions, a9 as FetchNextPageOptions, aa as FetchPreviousPageOptions, a0 as FetchQueryOptions, ac as FetchStatus, B as GetNextPageParamFunction, G as GetPreviousPageParamFunction, E as InfiniteData, al as InfiniteQueryObserverBaseResult, ao as InfiniteQueryObserverLoadingErrorResult, an as InfiniteQueryObserverLoadingResult, _ as InfiniteQueryObserverOptions, am as InfiniteQueryObserverPendingResult, ap as InfiniteQueryObserverRefetchErrorResult, as as InfiniteQueryObserverResult, aq as InfiniteQueryObserverSuccessResult, T as InfiniteQueryPageParamsOptions, I as InitialDataFunction, L as InitialPageParam, a7 as InvalidateOptions, a5 as InvalidateQueryFilters, aB as MutateFunction, aA as MutateOptions, p as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, ax as MutationFunction, at as MutationKey, aw as MutationMeta, e as MutationObserver, aC as MutationObserverBaseResult, aF as MutationObserverErrorResult, aD as MutationObserverIdleResult, aE as MutationObserverLoadingResult, az as MutationObserverOptions, aH as MutationObserverResult, aG as MutationObserverSuccessResult, ay as MutationOptions, av as MutationScope, q as MutationState, au as MutationStatus, H as NetworkMode, N as NoInfer, aN as NotifyEvent, aM as NotifyEventType, J as NotifyOnChangeProps, O as OmitKeyof, Y as Optional, P as PlaceholderDataFunction, z as QueriesPlaceholderDataFunction, o as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, aI as QueryClientConfig, j as QueryFilters, w as QueryFunction, y as QueryFunctionContext, t as QueryKey, A as QueryKeyHashFunction, F as QueryMeta, c as QueryObserver, ad as QueryObserverBaseResult, ag as QueryObserverLoadingErrorResult, af as QueryObserverLoadingResult, W as QueryObserverOptions, ae as QueryObserverPendingResult, ah as QueryObserverRefetchErrorResult, ak as QueryObserverResult, ai as QueryObserverSuccessResult, K as QueryOptions, x as QueryPersister, n as QueryState, ab as QueryStatus, a4 as RefetchOptions, a6 as RefetchQueryFilters, R as Register, a8 as ResetOptions, a3 as ResultOptions, aL as SetDataOptions, S as SkipToken, V as ThrowOnError, U as Updater, X as WithRequired, u as dataTagSymbol, h as hashKey, l as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, r as replaceEqualDeep, s as skipToken } from './types-
|
|
1
|
+
export { aK as CancelOptions, C as CancelledError, v as DataTag, D as DefaultError, aJ as DefaultOptions, $ as DefaultedInfiniteQueryObserverOptions, Z as DefaultedQueryObserverOptions, ar as DefinedInfiniteQueryObserverResult, aj as DefinedQueryObserverResult, a1 as EnsureQueryDataOptions, a2 as FetchInfiniteQueryOptions, a9 as FetchNextPageOptions, aa as FetchPreviousPageOptions, a0 as FetchQueryOptions, ac as FetchStatus, B as GetNextPageParamFunction, G as GetPreviousPageParamFunction, E as InfiniteData, al as InfiniteQueryObserverBaseResult, ao as InfiniteQueryObserverLoadingErrorResult, an as InfiniteQueryObserverLoadingResult, _ as InfiniteQueryObserverOptions, am as InfiniteQueryObserverPendingResult, ap as InfiniteQueryObserverRefetchErrorResult, as as InfiniteQueryObserverResult, aq as InfiniteQueryObserverSuccessResult, T as InfiniteQueryPageParamsOptions, I as InitialDataFunction, L as InitialPageParam, a7 as InvalidateOptions, a5 as InvalidateQueryFilters, aB as MutateFunction, aA as MutateOptions, p as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, ax as MutationFunction, at as MutationKey, aw as MutationMeta, e as MutationObserver, aC as MutationObserverBaseResult, aF as MutationObserverErrorResult, aD as MutationObserverIdleResult, aE as MutationObserverLoadingResult, az as MutationObserverOptions, aH as MutationObserverResult, aG as MutationObserverSuccessResult, ay as MutationOptions, av as MutationScope, q as MutationState, au as MutationStatus, H as NetworkMode, N as NoInfer, aN as NotifyEvent, aM as NotifyEventType, J as NotifyOnChangeProps, O as OmitKeyof, Y as Optional, P as PlaceholderDataFunction, z as QueriesPlaceholderDataFunction, o as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, aI as QueryClientConfig, j as QueryFilters, w as QueryFunction, y as QueryFunctionContext, t as QueryKey, A as QueryKeyHashFunction, F as QueryMeta, c as QueryObserver, ad as QueryObserverBaseResult, ag as QueryObserverLoadingErrorResult, af as QueryObserverLoadingResult, W as QueryObserverOptions, ae as QueryObserverPendingResult, ah as QueryObserverRefetchErrorResult, ak as QueryObserverResult, ai as QueryObserverSuccessResult, K as QueryOptions, x as QueryPersister, n as QueryState, ab as QueryStatus, a4 as RefetchOptions, a6 as RefetchQueryFilters, R as Register, a8 as ResetOptions, a3 as ResultOptions, aL as SetDataOptions, S as SkipToken, V as ThrowOnError, U as Updater, X as WithRequired, u as dataTagSymbol, h as hashKey, l as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, r as replaceEqualDeep, s as skipToken } from './types-Ya7vXgfL.cjs';
|
|
2
2
|
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs';
|
|
3
3
|
export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs';
|
|
4
4
|
export { notifyManager } from './notifyManager.cjs';
|
package/build/legacy/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aK as CancelOptions, C as CancelledError, v as DataTag, D as DefaultError, aJ as DefaultOptions, $ as DefaultedInfiniteQueryObserverOptions, Z as DefaultedQueryObserverOptions, ar as DefinedInfiniteQueryObserverResult, aj as DefinedQueryObserverResult, a1 as EnsureQueryDataOptions, a2 as FetchInfiniteQueryOptions, a9 as FetchNextPageOptions, aa as FetchPreviousPageOptions, a0 as FetchQueryOptions, ac as FetchStatus, B as GetNextPageParamFunction, G as GetPreviousPageParamFunction, E as InfiniteData, al as InfiniteQueryObserverBaseResult, ao as InfiniteQueryObserverLoadingErrorResult, an as InfiniteQueryObserverLoadingResult, _ as InfiniteQueryObserverOptions, am as InfiniteQueryObserverPendingResult, ap as InfiniteQueryObserverRefetchErrorResult, as as InfiniteQueryObserverResult, aq as InfiniteQueryObserverSuccessResult, T as InfiniteQueryPageParamsOptions, I as InitialDataFunction, L as InitialPageParam, a7 as InvalidateOptions, a5 as InvalidateQueryFilters, aB as MutateFunction, aA as MutateOptions, p as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, ax as MutationFunction, at as MutationKey, aw as MutationMeta, e as MutationObserver, aC as MutationObserverBaseResult, aF as MutationObserverErrorResult, aD as MutationObserverIdleResult, aE as MutationObserverLoadingResult, az as MutationObserverOptions, aH as MutationObserverResult, aG as MutationObserverSuccessResult, ay as MutationOptions, av as MutationScope, q as MutationState, au as MutationStatus, H as NetworkMode, N as NoInfer, aN as NotifyEvent, aM as NotifyEventType, J as NotifyOnChangeProps, O as OmitKeyof, Y as Optional, P as PlaceholderDataFunction, z as QueriesPlaceholderDataFunction, o as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, aI as QueryClientConfig, j as QueryFilters, w as QueryFunction, y as QueryFunctionContext, t as QueryKey, A as QueryKeyHashFunction, F as QueryMeta, c as QueryObserver, ad as QueryObserverBaseResult, ag as QueryObserverLoadingErrorResult, af as QueryObserverLoadingResult, W as QueryObserverOptions, ae as QueryObserverPendingResult, ah as QueryObserverRefetchErrorResult, ak as QueryObserverResult, ai as QueryObserverSuccessResult, K as QueryOptions, x as QueryPersister, n as QueryState, ab as QueryStatus, a4 as RefetchOptions, a6 as RefetchQueryFilters, R as Register, a8 as ResetOptions, a3 as ResultOptions, aL as SetDataOptions, S as SkipToken, V as ThrowOnError, U as Updater, X as WithRequired, u as dataTagSymbol, h as hashKey, l as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, r as replaceEqualDeep, s as skipToken } from './types-
|
|
1
|
+
export { aK as CancelOptions, C as CancelledError, v as DataTag, D as DefaultError, aJ as DefaultOptions, $ as DefaultedInfiniteQueryObserverOptions, Z as DefaultedQueryObserverOptions, ar as DefinedInfiniteQueryObserverResult, aj as DefinedQueryObserverResult, a1 as EnsureQueryDataOptions, a2 as FetchInfiniteQueryOptions, a9 as FetchNextPageOptions, aa as FetchPreviousPageOptions, a0 as FetchQueryOptions, ac as FetchStatus, B as GetNextPageParamFunction, G as GetPreviousPageParamFunction, E as InfiniteData, al as InfiniteQueryObserverBaseResult, ao as InfiniteQueryObserverLoadingErrorResult, an as InfiniteQueryObserverLoadingResult, _ as InfiniteQueryObserverOptions, am as InfiniteQueryObserverPendingResult, ap as InfiniteQueryObserverRefetchErrorResult, as as InfiniteQueryObserverResult, aq as InfiniteQueryObserverSuccessResult, T as InfiniteQueryPageParamsOptions, I as InitialDataFunction, L as InitialPageParam, a7 as InvalidateOptions, a5 as InvalidateQueryFilters, aB as MutateFunction, aA as MutateOptions, p as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, ax as MutationFunction, at as MutationKey, aw as MutationMeta, e as MutationObserver, aC as MutationObserverBaseResult, aF as MutationObserverErrorResult, aD as MutationObserverIdleResult, aE as MutationObserverLoadingResult, az as MutationObserverOptions, aH as MutationObserverResult, aG as MutationObserverSuccessResult, ay as MutationOptions, av as MutationScope, q as MutationState, au as MutationStatus, H as NetworkMode, N as NoInfer, aN as NotifyEvent, aM as NotifyEventType, J as NotifyOnChangeProps, O as OmitKeyof, Y as Optional, P as PlaceholderDataFunction, z as QueriesPlaceholderDataFunction, o as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, aI as QueryClientConfig, j as QueryFilters, w as QueryFunction, y as QueryFunctionContext, t as QueryKey, A as QueryKeyHashFunction, F as QueryMeta, c as QueryObserver, ad as QueryObserverBaseResult, ag as QueryObserverLoadingErrorResult, af as QueryObserverLoadingResult, W as QueryObserverOptions, ae as QueryObserverPendingResult, ah as QueryObserverRefetchErrorResult, ak as QueryObserverResult, ai as QueryObserverSuccessResult, K as QueryOptions, x as QueryPersister, n as QueryState, ab as QueryStatus, a4 as RefetchOptions, a6 as RefetchQueryFilters, R as Register, a8 as ResetOptions, a3 as ResultOptions, aL as SetDataOptions, S as SkipToken, V as ThrowOnError, U as Updater, X as WithRequired, u as dataTagSymbol, h as hashKey, l as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, r as replaceEqualDeep, s as skipToken } from './types-Br-AgPmc.js';
|
|
2
2
|
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js';
|
|
3
3
|
export { InfiniteQueryObserver } from './infiniteQueryObserver.js';
|
|
4
4
|
export { notifyManager } from './notifyManager.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aO as QueryBehavior, E as InfiniteData, T as InfiniteQueryPageParamsOptions } from './types-
|
|
1
|
+
import { aO as QueryBehavior, E as InfiniteData, T as InfiniteQueryPageParamsOptions } from './types-Ya7vXgfL.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aO as QueryBehavior, E as InfiniteData, T as InfiniteQueryPageParamsOptions } from './types-
|
|
1
|
+
import { aO as QueryBehavior, E as InfiniteData, T as InfiniteQueryPageParamsOptions } from './types-Br-AgPmc.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DefaultError, E as InfiniteData, t as QueryKey, c as QueryObserver, as as InfiniteQueryObserverResult, aP as ObserverFetchOptions, b as QueryClient, _ as InfiniteQueryObserverOptions, aQ as NotifyOptions, $ as DefaultedInfiniteQueryObserverOptions, a9 as FetchNextPageOptions, aa as FetchPreviousPageOptions, o as Query } from './types-
|
|
1
|
+
import { D as DefaultError, E as InfiniteData, t as QueryKey, c as QueryObserver, as as InfiniteQueryObserverResult, aP as ObserverFetchOptions, b as QueryClient, _ as InfiniteQueryObserverOptions, aQ as NotifyOptions, $ as DefaultedInfiniteQueryObserverOptions, a9 as FetchNextPageOptions, aa as FetchPreviousPageOptions, o as Query } from './types-Ya7vXgfL.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DefaultError, E as InfiniteData, t as QueryKey, c as QueryObserver, as as InfiniteQueryObserverResult, aP as ObserverFetchOptions, b as QueryClient, _ as InfiniteQueryObserverOptions, aQ as NotifyOptions, $ as DefaultedInfiniteQueryObserverOptions, a9 as FetchNextPageOptions, aa as FetchPreviousPageOptions, o as Query } from './types-
|
|
1
|
+
import { D as DefaultError, E as InfiniteData, t as QueryKey, c as QueryObserver, as as InfiniteQueryObserverResult, aP as ObserverFetchOptions, b as QueryClient, _ as InfiniteQueryObserverOptions, aQ as NotifyOptions, $ as DefaultedInfiniteQueryObserverOptions, a9 as FetchNextPageOptions, aa as FetchPreviousPageOptions, o as Query } from './types-Br-AgPmc.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
4
4
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.cjs';
|
|
2
|
-
export { bb as Action, p as Mutation, q as MutationState, bc as getDefaultState } from './types-
|
|
2
|
+
export { bb as Action, p as Mutation, q as MutationState, bc as getDefaultState } from './types-Ya7vXgfL.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.js';
|
|
2
|
-
export { bb as Action, p as Mutation, q as MutationState, bc as getDefaultState } from './types-
|
|
2
|
+
export { bb as Action, p as Mutation, q as MutationState, bc as getDefaultState } from './types-Br-AgPmc.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ak as QueryObserverResult, b as QueryClient, W as QueryObserverOptions, aQ as NotifyOptions, o as Query, t as QueryKey, c as QueryObserver } from './types-
|
|
1
|
+
import { ak as QueryObserverResult, b as QueryClient, W as QueryObserverOptions, aQ as NotifyOptions, o as Query, t as QueryKey, c as QueryObserver } from './types-Ya7vXgfL.cjs';
|
|
2
2
|
import { Subscribable } from './subscribable.cjs';
|
|
3
3
|
import './removable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ak as QueryObserverResult, b as QueryClient, W as QueryObserverOptions, aQ as NotifyOptions, o as Query, t as QueryKey, c as QueryObserver } from './types-
|
|
1
|
+
import { ak as QueryObserverResult, b as QueryClient, W as QueryObserverOptions, aQ as NotifyOptions, o as Query, t as QueryKey, c as QueryObserver } from './types-Br-AgPmc.js';
|
|
2
2
|
import { Subscribable } from './subscribable.js';
|
|
3
3
|
import './removable.js';
|
|
4
4
|
|
package/build/legacy/query.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.cjs';
|
|
2
|
-
export { aV as Action, aR as FetchContext, aS as FetchDirection, aT as FetchMeta, aU as FetchOptions, o as Query, aO as QueryBehavior, n as QueryState, aW as SetStateOptions, aX as fetchState } from './types-
|
|
2
|
+
export { aV as Action, aR as FetchContext, aS as FetchDirection, aT as FetchMeta, aU as FetchOptions, o as Query, aO as QueryBehavior, n as QueryState, aW as SetStateOptions, aX as fetchState } from './types-Ya7vXgfL.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
package/build/legacy/query.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.js';
|
|
2
|
-
export { aV as Action, aR as FetchContext, aS as FetchDirection, aT as FetchMeta, aU as FetchOptions, o as Query, aO as QueryBehavior, n as QueryState, aW as SetStateOptions, aX as fetchState } from './types-
|
|
2
|
+
export { aV as Action, aR as FetchContext, aS as FetchDirection, aT as FetchMeta, aU as FetchOptions, o as Query, aO as QueryBehavior, n as QueryState, aW as SetStateOptions, aX as fetchState } from './types-Br-AgPmc.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './subscribable.cjs';
|
|
2
|
-
export { aQ as NotifyOptions, aP as ObserverFetchOptions, c as QueryObserver } from './types-
|
|
2
|
+
export { aQ as NotifyOptions, aP as ObserverFetchOptions, c as QueryObserver } from './types-Ya7vXgfL.cjs';
|
|
3
3
|
import './removable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CancelledError, bf as RetryDelayValue, be as RetryValue, bd as Retryer, bg as canFetch, bh as createRetryer, l as isCancelledError } from './types-
|
|
1
|
+
export { C as CancelledError, bf as RetryDelayValue, be as RetryValue, bd as Retryer, bg as canFetch, bh as createRetryer, l as isCancelledError } from './types-Ya7vXgfL.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CancelledError, bf as RetryDelayValue, be as RetryValue, bd as Retryer, bg as canFetch, bh as createRetryer, l as isCancelledError } from './types-
|
|
1
|
+
export { C as CancelledError, bf as RetryDelayValue, be as RetryValue, bd as Retryer, bg as canFetch, bh as createRetryer, l as isCancelledError } from './types-Br-AgPmc.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -513,11 +513,19 @@ type QueryFunctionContext<TQueryKey extends QueryKey = QueryKey, TPageParam = ne
|
|
|
513
513
|
signal: AbortSignal;
|
|
514
514
|
meta: QueryMeta | undefined;
|
|
515
515
|
pageParam?: unknown;
|
|
516
|
-
|
|
516
|
+
/**
|
|
517
|
+
* @deprecated
|
|
518
|
+
* if you want access to the direction, you can add it to the pageParam
|
|
519
|
+
*/
|
|
520
|
+
direction?: unknown;
|
|
517
521
|
} : {
|
|
518
522
|
queryKey: TQueryKey;
|
|
519
523
|
signal: AbortSignal;
|
|
520
524
|
pageParam: TPageParam;
|
|
525
|
+
/**
|
|
526
|
+
* @deprecated
|
|
527
|
+
* if you want access to the direction, you can add it to the pageParam
|
|
528
|
+
*/
|
|
521
529
|
direction: FetchDirection;
|
|
522
530
|
meta: QueryMeta | undefined;
|
|
523
531
|
};
|
|
@@ -728,33 +736,122 @@ interface FetchPreviousPageOptions extends ResultOptions {
|
|
|
728
736
|
type QueryStatus = 'pending' | 'error' | 'success';
|
|
729
737
|
type FetchStatus = 'fetching' | 'paused' | 'idle';
|
|
730
738
|
interface QueryObserverBaseResult<TData = unknown, TError = DefaultError> {
|
|
739
|
+
/**
|
|
740
|
+
* The last successfully resolved data for the query.
|
|
741
|
+
* - Defaults to `undefined`.
|
|
742
|
+
*/
|
|
731
743
|
data: TData | undefined;
|
|
744
|
+
/**
|
|
745
|
+
* The timestamp for when the query most recently returned the `status` as `"success"`.
|
|
746
|
+
*/
|
|
732
747
|
dataUpdatedAt: number;
|
|
748
|
+
/**
|
|
749
|
+
* The error object for the query, if an error was thrown.
|
|
750
|
+
* - Defaults to `null`.
|
|
751
|
+
*/
|
|
733
752
|
error: TError | null;
|
|
753
|
+
/**
|
|
754
|
+
* The timestamp for when the query most recently returned the `status` as `"error"`.
|
|
755
|
+
*/
|
|
734
756
|
errorUpdatedAt: number;
|
|
757
|
+
/**
|
|
758
|
+
* The failure count for the query.
|
|
759
|
+
* - Incremented every time the query fails.
|
|
760
|
+
* - Reset to `0` when the query succeeds.
|
|
761
|
+
*/
|
|
735
762
|
failureCount: number;
|
|
763
|
+
/**
|
|
764
|
+
* The failure reason for the query retry.
|
|
765
|
+
* - Reset to `null` when the query succeeds.
|
|
766
|
+
*/
|
|
736
767
|
failureReason: TError | null;
|
|
768
|
+
/**
|
|
769
|
+
* The sum of all errors.
|
|
770
|
+
*/
|
|
737
771
|
errorUpdateCount: number;
|
|
772
|
+
/**
|
|
773
|
+
* A derived boolean from the `status` variable, provided for convenience.
|
|
774
|
+
* - `true` if the query attempt resulted in an error.
|
|
775
|
+
*/
|
|
738
776
|
isError: boolean;
|
|
777
|
+
/**
|
|
778
|
+
* Will be `true` if the query has been fetched.
|
|
779
|
+
*/
|
|
739
780
|
isFetched: boolean;
|
|
781
|
+
/**
|
|
782
|
+
* Will be `true` if the query has been fetched after the component mounted.
|
|
783
|
+
* - This property can be used to not show any previously cached data.
|
|
784
|
+
*/
|
|
740
785
|
isFetchedAfterMount: boolean;
|
|
786
|
+
/**
|
|
787
|
+
* A derived boolean from the `fetchStatus` variable, provided for convenience.
|
|
788
|
+
* - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.
|
|
789
|
+
*/
|
|
741
790
|
isFetching: boolean;
|
|
791
|
+
/**
|
|
792
|
+
* Is `true` whenever the first fetch for a query is in-flight.
|
|
793
|
+
* - Is the same as `isFetching && isPending`.
|
|
794
|
+
*/
|
|
742
795
|
isLoading: boolean;
|
|
796
|
+
/**
|
|
797
|
+
* Will be `pending` if there's no cached data and no query attempt was finished yet.
|
|
798
|
+
*/
|
|
743
799
|
isPending: boolean;
|
|
800
|
+
/**
|
|
801
|
+
* Will be `true` if the query failed while fetching for the first time.
|
|
802
|
+
*/
|
|
744
803
|
isLoadingError: boolean;
|
|
745
804
|
/**
|
|
746
|
-
* @deprecated isInitialLoading is being deprecated in favor of isLoading
|
|
805
|
+
* @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`
|
|
747
806
|
* and will be removed in the next major version.
|
|
748
807
|
*/
|
|
749
808
|
isInitialLoading: boolean;
|
|
809
|
+
/**
|
|
810
|
+
* A derived boolean from the `fetchStatus` variable, provided for convenience.
|
|
811
|
+
* - The query wanted to fetch, but has been `paused`.
|
|
812
|
+
*/
|
|
750
813
|
isPaused: boolean;
|
|
814
|
+
/**
|
|
815
|
+
* Will be `true` if the data shown is the placeholder data.
|
|
816
|
+
*/
|
|
751
817
|
isPlaceholderData: boolean;
|
|
818
|
+
/**
|
|
819
|
+
* Will be `true` if the query failed while refetching.
|
|
820
|
+
*/
|
|
752
821
|
isRefetchError: boolean;
|
|
822
|
+
/**
|
|
823
|
+
* Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.
|
|
824
|
+
* - Is the same as `isFetching && !isPending`.
|
|
825
|
+
*/
|
|
753
826
|
isRefetching: boolean;
|
|
827
|
+
/**
|
|
828
|
+
* Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.
|
|
829
|
+
*/
|
|
754
830
|
isStale: boolean;
|
|
831
|
+
/**
|
|
832
|
+
* A derived boolean from the `status` variable, provided for convenience.
|
|
833
|
+
* - `true` if the query has received a response with no errors and is ready to display its data.
|
|
834
|
+
*/
|
|
755
835
|
isSuccess: boolean;
|
|
836
|
+
/**
|
|
837
|
+
* A function to manually refetch the query.
|
|
838
|
+
*/
|
|
756
839
|
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<TData, TError>>;
|
|
840
|
+
/**
|
|
841
|
+
* The status of the query.
|
|
842
|
+
* - Will be:
|
|
843
|
+
* - `pending` if there's no cached data and no query attempt was finished yet.
|
|
844
|
+
* - `error` if the query attempt resulted in an error.
|
|
845
|
+
* - `success` if the query has received a response with no errors and is ready to display its data.
|
|
846
|
+
*/
|
|
757
847
|
status: QueryStatus;
|
|
848
|
+
/**
|
|
849
|
+
* The fetch status of the query.
|
|
850
|
+
* - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.
|
|
851
|
+
* - `paused`: The query wanted to fetch, but has been `paused`.
|
|
852
|
+
* - `idle`: The query is not fetching.
|
|
853
|
+
* - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.
|
|
854
|
+
*/
|
|
758
855
|
fetchStatus: FetchStatus;
|
|
759
856
|
}
|
|
760
857
|
interface QueryObserverPendingResult<TData = unknown, TError = DefaultError> extends QueryObserverBaseResult<TData, TError> {
|
|
@@ -911,11 +1008,64 @@ interface MutateOptions<TData = unknown, TError = DefaultError, TVariables = voi
|
|
|
911
1008
|
}
|
|
912
1009
|
type MutateFunction<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown> = (variables: TVariables, options?: MutateOptions<TData, TError, TVariables, TContext>) => Promise<TData>;
|
|
913
1010
|
interface MutationObserverBaseResult<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown> extends MutationState<TData, TError, TVariables, TContext> {
|
|
1011
|
+
/**
|
|
1012
|
+
* The last successfully resolved data for the mutation.
|
|
1013
|
+
* - Defaults to `undefined`.
|
|
1014
|
+
*/
|
|
1015
|
+
data: TData | undefined;
|
|
1016
|
+
/**
|
|
1017
|
+
* The variables object passed to the `mutationFn`.
|
|
1018
|
+
* - Defaults to `undefined`.
|
|
1019
|
+
*/
|
|
1020
|
+
variables: TVariables | undefined;
|
|
1021
|
+
/**
|
|
1022
|
+
* The error object for the mutation, if an error was encountered.
|
|
1023
|
+
* - Defaults to `null`.
|
|
1024
|
+
*/
|
|
1025
|
+
error: TError | null;
|
|
1026
|
+
/**
|
|
1027
|
+
* A boolean variable derived from `status`.
|
|
1028
|
+
* - `true` if the last mutation attempt resulted in an error.
|
|
1029
|
+
*/
|
|
914
1030
|
isError: boolean;
|
|
1031
|
+
/**
|
|
1032
|
+
* A boolean variable derived from `status`.
|
|
1033
|
+
* - `true` if the mutation is in its initial state prior to executing.
|
|
1034
|
+
*/
|
|
915
1035
|
isIdle: boolean;
|
|
1036
|
+
/**
|
|
1037
|
+
* A boolean variable derived from `status`.
|
|
1038
|
+
* - `true` if the mutation is currently executing.
|
|
1039
|
+
*/
|
|
916
1040
|
isPending: boolean;
|
|
1041
|
+
/**
|
|
1042
|
+
* A boolean variable derived from `status`.
|
|
1043
|
+
* - `true` if the last mutation attempt was successful.
|
|
1044
|
+
*/
|
|
917
1045
|
isSuccess: boolean;
|
|
1046
|
+
/**
|
|
1047
|
+
* The status of the mutation.
|
|
1048
|
+
* - Will be:
|
|
1049
|
+
* - `idle` initial status prior to the mutation function executing.
|
|
1050
|
+
* - `pending` if the mutation is currently executing.
|
|
1051
|
+
* - `error` if the last mutation attempt resulted in an error.
|
|
1052
|
+
* - `success` if the last mutation attempt was successful.
|
|
1053
|
+
*/
|
|
1054
|
+
status: MutationStatus;
|
|
1055
|
+
/**
|
|
1056
|
+
* The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.
|
|
1057
|
+
* @param variables - The variables object to pass to the `mutationFn`.
|
|
1058
|
+
* @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.
|
|
1059
|
+
* @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.
|
|
1060
|
+
* @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.
|
|
1061
|
+
* @remarks
|
|
1062
|
+
* - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.
|
|
1063
|
+
* - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.
|
|
1064
|
+
*/
|
|
918
1065
|
mutate: MutateFunction<TData, TError, TVariables, TContext>;
|
|
1066
|
+
/**
|
|
1067
|
+
* A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).
|
|
1068
|
+
*/
|
|
919
1069
|
reset: () => void;
|
|
920
1070
|
}
|
|
921
1071
|
interface MutationObserverIdleResult<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown> extends MutationObserverBaseResult<TData, TError, TVariables, TContext> {
|
|
@@ -513,11 +513,19 @@ type QueryFunctionContext<TQueryKey extends QueryKey = QueryKey, TPageParam = ne
|
|
|
513
513
|
signal: AbortSignal;
|
|
514
514
|
meta: QueryMeta | undefined;
|
|
515
515
|
pageParam?: unknown;
|
|
516
|
-
|
|
516
|
+
/**
|
|
517
|
+
* @deprecated
|
|
518
|
+
* if you want access to the direction, you can add it to the pageParam
|
|
519
|
+
*/
|
|
520
|
+
direction?: unknown;
|
|
517
521
|
} : {
|
|
518
522
|
queryKey: TQueryKey;
|
|
519
523
|
signal: AbortSignal;
|
|
520
524
|
pageParam: TPageParam;
|
|
525
|
+
/**
|
|
526
|
+
* @deprecated
|
|
527
|
+
* if you want access to the direction, you can add it to the pageParam
|
|
528
|
+
*/
|
|
521
529
|
direction: FetchDirection;
|
|
522
530
|
meta: QueryMeta | undefined;
|
|
523
531
|
};
|
|
@@ -728,33 +736,122 @@ interface FetchPreviousPageOptions extends ResultOptions {
|
|
|
728
736
|
type QueryStatus = 'pending' | 'error' | 'success';
|
|
729
737
|
type FetchStatus = 'fetching' | 'paused' | 'idle';
|
|
730
738
|
interface QueryObserverBaseResult<TData = unknown, TError = DefaultError> {
|
|
739
|
+
/**
|
|
740
|
+
* The last successfully resolved data for the query.
|
|
741
|
+
* - Defaults to `undefined`.
|
|
742
|
+
*/
|
|
731
743
|
data: TData | undefined;
|
|
744
|
+
/**
|
|
745
|
+
* The timestamp for when the query most recently returned the `status` as `"success"`.
|
|
746
|
+
*/
|
|
732
747
|
dataUpdatedAt: number;
|
|
748
|
+
/**
|
|
749
|
+
* The error object for the query, if an error was thrown.
|
|
750
|
+
* - Defaults to `null`.
|
|
751
|
+
*/
|
|
733
752
|
error: TError | null;
|
|
753
|
+
/**
|
|
754
|
+
* The timestamp for when the query most recently returned the `status` as `"error"`.
|
|
755
|
+
*/
|
|
734
756
|
errorUpdatedAt: number;
|
|
757
|
+
/**
|
|
758
|
+
* The failure count for the query.
|
|
759
|
+
* - Incremented every time the query fails.
|
|
760
|
+
* - Reset to `0` when the query succeeds.
|
|
761
|
+
*/
|
|
735
762
|
failureCount: number;
|
|
763
|
+
/**
|
|
764
|
+
* The failure reason for the query retry.
|
|
765
|
+
* - Reset to `null` when the query succeeds.
|
|
766
|
+
*/
|
|
736
767
|
failureReason: TError | null;
|
|
768
|
+
/**
|
|
769
|
+
* The sum of all errors.
|
|
770
|
+
*/
|
|
737
771
|
errorUpdateCount: number;
|
|
772
|
+
/**
|
|
773
|
+
* A derived boolean from the `status` variable, provided for convenience.
|
|
774
|
+
* - `true` if the query attempt resulted in an error.
|
|
775
|
+
*/
|
|
738
776
|
isError: boolean;
|
|
777
|
+
/**
|
|
778
|
+
* Will be `true` if the query has been fetched.
|
|
779
|
+
*/
|
|
739
780
|
isFetched: boolean;
|
|
781
|
+
/**
|
|
782
|
+
* Will be `true` if the query has been fetched after the component mounted.
|
|
783
|
+
* - This property can be used to not show any previously cached data.
|
|
784
|
+
*/
|
|
740
785
|
isFetchedAfterMount: boolean;
|
|
786
|
+
/**
|
|
787
|
+
* A derived boolean from the `fetchStatus` variable, provided for convenience.
|
|
788
|
+
* - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.
|
|
789
|
+
*/
|
|
741
790
|
isFetching: boolean;
|
|
791
|
+
/**
|
|
792
|
+
* Is `true` whenever the first fetch for a query is in-flight.
|
|
793
|
+
* - Is the same as `isFetching && isPending`.
|
|
794
|
+
*/
|
|
742
795
|
isLoading: boolean;
|
|
796
|
+
/**
|
|
797
|
+
* Will be `pending` if there's no cached data and no query attempt was finished yet.
|
|
798
|
+
*/
|
|
743
799
|
isPending: boolean;
|
|
800
|
+
/**
|
|
801
|
+
* Will be `true` if the query failed while fetching for the first time.
|
|
802
|
+
*/
|
|
744
803
|
isLoadingError: boolean;
|
|
745
804
|
/**
|
|
746
|
-
* @deprecated isInitialLoading is being deprecated in favor of isLoading
|
|
805
|
+
* @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`
|
|
747
806
|
* and will be removed in the next major version.
|
|
748
807
|
*/
|
|
749
808
|
isInitialLoading: boolean;
|
|
809
|
+
/**
|
|
810
|
+
* A derived boolean from the `fetchStatus` variable, provided for convenience.
|
|
811
|
+
* - The query wanted to fetch, but has been `paused`.
|
|
812
|
+
*/
|
|
750
813
|
isPaused: boolean;
|
|
814
|
+
/**
|
|
815
|
+
* Will be `true` if the data shown is the placeholder data.
|
|
816
|
+
*/
|
|
751
817
|
isPlaceholderData: boolean;
|
|
818
|
+
/**
|
|
819
|
+
* Will be `true` if the query failed while refetching.
|
|
820
|
+
*/
|
|
752
821
|
isRefetchError: boolean;
|
|
822
|
+
/**
|
|
823
|
+
* Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.
|
|
824
|
+
* - Is the same as `isFetching && !isPending`.
|
|
825
|
+
*/
|
|
753
826
|
isRefetching: boolean;
|
|
827
|
+
/**
|
|
828
|
+
* Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.
|
|
829
|
+
*/
|
|
754
830
|
isStale: boolean;
|
|
831
|
+
/**
|
|
832
|
+
* A derived boolean from the `status` variable, provided for convenience.
|
|
833
|
+
* - `true` if the query has received a response with no errors and is ready to display its data.
|
|
834
|
+
*/
|
|
755
835
|
isSuccess: boolean;
|
|
836
|
+
/**
|
|
837
|
+
* A function to manually refetch the query.
|
|
838
|
+
*/
|
|
756
839
|
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<TData, TError>>;
|
|
840
|
+
/**
|
|
841
|
+
* The status of the query.
|
|
842
|
+
* - Will be:
|
|
843
|
+
* - `pending` if there's no cached data and no query attempt was finished yet.
|
|
844
|
+
* - `error` if the query attempt resulted in an error.
|
|
845
|
+
* - `success` if the query has received a response with no errors and is ready to display its data.
|
|
846
|
+
*/
|
|
757
847
|
status: QueryStatus;
|
|
848
|
+
/**
|
|
849
|
+
* The fetch status of the query.
|
|
850
|
+
* - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.
|
|
851
|
+
* - `paused`: The query wanted to fetch, but has been `paused`.
|
|
852
|
+
* - `idle`: The query is not fetching.
|
|
853
|
+
* - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.
|
|
854
|
+
*/
|
|
758
855
|
fetchStatus: FetchStatus;
|
|
759
856
|
}
|
|
760
857
|
interface QueryObserverPendingResult<TData = unknown, TError = DefaultError> extends QueryObserverBaseResult<TData, TError> {
|
|
@@ -911,11 +1008,64 @@ interface MutateOptions<TData = unknown, TError = DefaultError, TVariables = voi
|
|
|
911
1008
|
}
|
|
912
1009
|
type MutateFunction<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown> = (variables: TVariables, options?: MutateOptions<TData, TError, TVariables, TContext>) => Promise<TData>;
|
|
913
1010
|
interface MutationObserverBaseResult<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown> extends MutationState<TData, TError, TVariables, TContext> {
|
|
1011
|
+
/**
|
|
1012
|
+
* The last successfully resolved data for the mutation.
|
|
1013
|
+
* - Defaults to `undefined`.
|
|
1014
|
+
*/
|
|
1015
|
+
data: TData | undefined;
|
|
1016
|
+
/**
|
|
1017
|
+
* The variables object passed to the `mutationFn`.
|
|
1018
|
+
* - Defaults to `undefined`.
|
|
1019
|
+
*/
|
|
1020
|
+
variables: TVariables | undefined;
|
|
1021
|
+
/**
|
|
1022
|
+
* The error object for the mutation, if an error was encountered.
|
|
1023
|
+
* - Defaults to `null`.
|
|
1024
|
+
*/
|
|
1025
|
+
error: TError | null;
|
|
1026
|
+
/**
|
|
1027
|
+
* A boolean variable derived from `status`.
|
|
1028
|
+
* - `true` if the last mutation attempt resulted in an error.
|
|
1029
|
+
*/
|
|
914
1030
|
isError: boolean;
|
|
1031
|
+
/**
|
|
1032
|
+
* A boolean variable derived from `status`.
|
|
1033
|
+
* - `true` if the mutation is in its initial state prior to executing.
|
|
1034
|
+
*/
|
|
915
1035
|
isIdle: boolean;
|
|
1036
|
+
/**
|
|
1037
|
+
* A boolean variable derived from `status`.
|
|
1038
|
+
* - `true` if the mutation is currently executing.
|
|
1039
|
+
*/
|
|
916
1040
|
isPending: boolean;
|
|
1041
|
+
/**
|
|
1042
|
+
* A boolean variable derived from `status`.
|
|
1043
|
+
* - `true` if the last mutation attempt was successful.
|
|
1044
|
+
*/
|
|
917
1045
|
isSuccess: boolean;
|
|
1046
|
+
/**
|
|
1047
|
+
* The status of the mutation.
|
|
1048
|
+
* - Will be:
|
|
1049
|
+
* - `idle` initial status prior to the mutation function executing.
|
|
1050
|
+
* - `pending` if the mutation is currently executing.
|
|
1051
|
+
* - `error` if the last mutation attempt resulted in an error.
|
|
1052
|
+
* - `success` if the last mutation attempt was successful.
|
|
1053
|
+
*/
|
|
1054
|
+
status: MutationStatus;
|
|
1055
|
+
/**
|
|
1056
|
+
* The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.
|
|
1057
|
+
* @param variables - The variables object to pass to the `mutationFn`.
|
|
1058
|
+
* @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.
|
|
1059
|
+
* @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.
|
|
1060
|
+
* @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.
|
|
1061
|
+
* @remarks
|
|
1062
|
+
* - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.
|
|
1063
|
+
* - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.
|
|
1064
|
+
*/
|
|
918
1065
|
mutate: MutateFunction<TData, TError, TVariables, TContext>;
|
|
1066
|
+
/**
|
|
1067
|
+
* A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).
|
|
1068
|
+
*/
|
|
919
1069
|
reset: () => void;
|
|
920
1070
|
}
|
|
921
1071
|
interface MutationObserverIdleResult<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown> extends MutationObserverBaseResult<TData, TError, TVariables, TContext> {
|