Socket
Socket
Sign inDemoInstall

@tanstack/query-core

Package Overview
Dependencies
0
Maintainers
2
Versions
239
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.35.5 to 5.36.0

build/legacy/types-B0i0SaOM.d.ts

2

build/legacy/hydration.d.ts

@@ -1,2 +0,2 @@

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';
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-B0i0SaOM.js';
import './removable.js';

@@ -3,0 +3,0 @@ import './subscribable.js';

@@ -1,2 +0,2 @@

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';
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-B0i0SaOM.js';
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js';

@@ -3,0 +3,0 @@ export { InfiniteQueryObserver } from './infiniteQueryObserver.js';

@@ -1,2 +0,2 @@

import { aO as QueryBehavior, E as InfiniteData, T as InfiniteQueryPageParamsOptions } from './types-Br-AgPmc.js';
import { aO as QueryBehavior, E as InfiniteData, T as InfiniteQueryPageParamsOptions } from './types-B0i0SaOM.js';
import './removable.js';

@@ -3,0 +3,0 @@ import './subscribable.js';

@@ -1,2 +0,2 @@

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';
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-B0i0SaOM.js';
import './removable.js';

@@ -3,0 +3,0 @@ import './subscribable.js';

@@ -49,10 +49,13 @@ import "./chunk-2HYBKCYP.js";

createResult(query, options) {
var _a, _b, _c, _d;
var _a, _b;
const { state } = query;
const result = super.createResult(query, options);
const { isFetching, isRefetching } = result;
const isFetchingNextPage = isFetching && ((_b = (_a = state.fetchMeta) == null ? void 0 : _a.fetchMore) == null ? void 0 : _b.direction) === "forward";
const isFetchingPreviousPage = isFetching && ((_d = (_c = state.fetchMeta) == null ? void 0 : _c.fetchMore) == null ? void 0 : _d.direction) === "backward";
return {
...result,
const parentResult = super.createResult(query, options);
const { isFetching, isRefetching, isError, isRefetchError } = parentResult;
const fetchDirection = (_b = (_a = state.fetchMeta) == null ? void 0 : _a.fetchMore) == null ? void 0 : _b.direction;
const isFetchNextPageError = isError && fetchDirection === "forward";
const isFetchingNextPage = isFetching && fetchDirection === "forward";
const isFetchPreviousPageError = isError && fetchDirection === "backward";
const isFetchingPreviousPage = isFetching && fetchDirection === "backward";
const result = {
...parentResult,
fetchNextPage: this.fetchNextPage,

@@ -62,6 +65,10 @@ fetchPreviousPage: this.fetchPreviousPage,

hasPreviousPage: hasPreviousPage(options, state.data),
isFetchNextPageError,
isFetchingNextPage,
isFetchPreviousPageError,
isFetchingPreviousPage,
isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,
isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage
};
return result;
}

@@ -68,0 +75,0 @@ };

import './removable.js';
export { bb as Action, p as Mutation, q as MutationState, bc as getDefaultState } from './types-Br-AgPmc.js';
export { bb as Action, p as Mutation, q as MutationState, bc as getDefaultState } from './types-B0i0SaOM.js';
import './subscribable.js';

@@ -1,3 +0,3 @@

export { M as MutationCache, d as MutationCacheNotifyEvent } from './types-Br-AgPmc.js';
export { M as MutationCache, d as MutationCacheNotifyEvent } from './types-B0i0SaOM.js';
import './subscribable.js';
import './removable.js';
import './subscribable.js';
export { e as MutationObserver } from './types-Br-AgPmc.js';
export { e as MutationObserver } from './types-B0i0SaOM.js';
import './removable.js';

@@ -1,2 +0,2 @@

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';
import { ak as QueryObserverResult, b as QueryClient, W as QueryObserverOptions, aQ as NotifyOptions, o as Query, t as QueryKey, c as QueryObserver } from './types-B0i0SaOM.js';
import { Subscribable } from './subscribable.js';

@@ -3,0 +3,0 @@ import './removable.js';

import './removable.js';
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';
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-B0i0SaOM.js';
import './subscribable.js';

@@ -1,3 +0,3 @@

export { Q as QueryCache, a as QueryCacheNotifyEvent, ba as QueryStore } from './types-Br-AgPmc.js';
export { Q as QueryCache, a as QueryCacheNotifyEvent, ba as QueryStore } from './types-B0i0SaOM.js';
import './subscribable.js';
import './removable.js';

@@ -1,3 +0,3 @@

export { b as QueryClient } from './types-Br-AgPmc.js';
export { b as QueryClient } from './types-B0i0SaOM.js';
import './removable.js';
import './subscribable.js';
import './subscribable.js';
export { aQ as NotifyOptions, aP as ObserverFetchOptions, c as QueryObserver } from './types-Br-AgPmc.js';
export { aQ as NotifyOptions, aP as ObserverFetchOptions, c as QueryObserver } from './types-B0i0SaOM.js';
import './removable.js';

@@ -1,3 +0,3 @@

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';
export { C as CancelledError, bf as RetryDelayValue, be as RetryValue, bd as Retryer, bg as canFetch, bh as createRetryer, l as isCancelledError } from './types-B0i0SaOM.js';
import './removable.js';
import './subscribable.js';

@@ -1,3 +0,3 @@

export { aK as CancelOptions, 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, ax as MutationFunction, at as MutationKey, aw as MutationMeta, 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, 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, aI as QueryClientConfig, w as QueryFunction, y as QueryFunctionContext, t as QueryKey, A as QueryKeyHashFunction, F as QueryMeta, 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, ab as QueryStatus, a4 as RefetchOptions, a6 as RefetchQueryFilters, R as Register, a8 as ResetOptions, a3 as ResultOptions, aL as SetDataOptions, V as ThrowOnError, X as WithRequired, u as dataTagSymbol } from './types-Br-AgPmc.js';
export { aK as CancelOptions, 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, ax as MutationFunction, at as MutationKey, aw as MutationMeta, 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, 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, aI as QueryClientConfig, w as QueryFunction, y as QueryFunctionContext, t as QueryKey, A as QueryKeyHashFunction, F as QueryMeta, 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, ab as QueryStatus, a4 as RefetchOptions, a6 as RefetchQueryFilters, R as Register, a8 as ResetOptions, a3 as ResultOptions, aL as SetDataOptions, V as ThrowOnError, X as WithRequired, u as dataTagSymbol } from './types-B0i0SaOM.js';
import './removable.js';
import './subscribable.js';

@@ -1,3 +0,3 @@

export { g as MutationFilters, j as QueryFilters, aY as QueryTypeFilter, S as SkipToken, U as Updater, b8 as addToEnd, b9 as addToStart, a_ as functionalUpdate, h as hashKey, b1 as hashQueryKeyByOptions, b4 as isPlainArray, b5 as isPlainObject, i as isServer, a$ as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, aZ as noop, b2 as partialMatchKey, b7 as replaceData, r as replaceEqualDeep, b3 as shallowEqualObjects, s as skipToken, b6 as sleep, b0 as timeUntilStale } from './types-Br-AgPmc.js';
export { g as MutationFilters, j as QueryFilters, aY as QueryTypeFilter, S as SkipToken, U as Updater, b8 as addToEnd, b9 as addToStart, a_ as functionalUpdate, h as hashKey, b1 as hashQueryKeyByOptions, b4 as isPlainArray, b5 as isPlainObject, i as isServer, a$ as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, aZ as noop, b2 as partialMatchKey, b7 as replaceData, r as replaceEqualDeep, b3 as shallowEqualObjects, s as skipToken, b6 as sleep, b0 as timeUntilStale } from './types-B0i0SaOM.js';
import './removable.js';
import './subscribable.js';

@@ -1,2 +0,2 @@

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';
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-B0i0SaOM.js';
import './removable.js';

@@ -3,0 +3,0 @@ import './subscribable.js';

@@ -1,2 +0,2 @@

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';
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-B0i0SaOM.js';
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js';

@@ -3,0 +3,0 @@ export { InfiniteQueryObserver } from './infiniteQueryObserver.js';

@@ -1,2 +0,2 @@

import { aO as QueryBehavior, E as InfiniteData, T as InfiniteQueryPageParamsOptions } from './types-Br-AgPmc.js';
import { aO as QueryBehavior, E as InfiniteData, T as InfiniteQueryPageParamsOptions } from './types-B0i0SaOM.js';
import './removable.js';

@@ -3,0 +3,0 @@ import './subscribable.js';

@@ -1,2 +0,2 @@

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';
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-B0i0SaOM.js';
import './removable.js';

@@ -3,0 +3,0 @@ import './subscribable.js';

@@ -48,8 +48,11 @@ // src/infiniteQueryObserver.ts

const { state } = query;
const result = super.createResult(query, options);
const { isFetching, isRefetching } = result;
const isFetchingNextPage = isFetching && state.fetchMeta?.fetchMore?.direction === "forward";
const isFetchingPreviousPage = isFetching && state.fetchMeta?.fetchMore?.direction === "backward";
return {
...result,
const parentResult = super.createResult(query, options);
const { isFetching, isRefetching, isError, isRefetchError } = parentResult;
const fetchDirection = state.fetchMeta?.fetchMore?.direction;
const isFetchNextPageError = isError && fetchDirection === "forward";
const isFetchingNextPage = isFetching && fetchDirection === "forward";
const isFetchPreviousPageError = isError && fetchDirection === "backward";
const isFetchingPreviousPage = isFetching && fetchDirection === "backward";
const result = {
...parentResult,
fetchNextPage: this.fetchNextPage,

@@ -59,6 +62,10 @@ fetchPreviousPage: this.fetchPreviousPage,

hasPreviousPage: hasPreviousPage(options, state.data),
isFetchNextPageError,
isFetchingNextPage,
isFetchPreviousPageError,
isFetchingPreviousPage,
isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,
isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage
};
return result;
}

@@ -65,0 +72,0 @@ };

import './removable.js';
export { bb as Action, p as Mutation, q as MutationState, bc as getDefaultState } from './types-Br-AgPmc.js';
export { bb as Action, p as Mutation, q as MutationState, bc as getDefaultState } from './types-B0i0SaOM.js';
import './subscribable.js';

@@ -1,3 +0,3 @@

export { M as MutationCache, d as MutationCacheNotifyEvent } from './types-Br-AgPmc.js';
export { M as MutationCache, d as MutationCacheNotifyEvent } from './types-B0i0SaOM.js';
import './subscribable.js';
import './removable.js';
import './subscribable.js';
export { e as MutationObserver } from './types-Br-AgPmc.js';
export { e as MutationObserver } from './types-B0i0SaOM.js';
import './removable.js';

@@ -1,2 +0,2 @@

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';
import { ak as QueryObserverResult, b as QueryClient, W as QueryObserverOptions, aQ as NotifyOptions, o as Query, t as QueryKey, c as QueryObserver } from './types-B0i0SaOM.js';
import { Subscribable } from './subscribable.js';

@@ -3,0 +3,0 @@ import './removable.js';

import './removable.js';
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';
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-B0i0SaOM.js';
import './subscribable.js';

@@ -1,3 +0,3 @@

export { Q as QueryCache, a as QueryCacheNotifyEvent, ba as QueryStore } from './types-Br-AgPmc.js';
export { Q as QueryCache, a as QueryCacheNotifyEvent, ba as QueryStore } from './types-B0i0SaOM.js';
import './subscribable.js';
import './removable.js';

@@ -1,3 +0,3 @@

export { b as QueryClient } from './types-Br-AgPmc.js';
export { b as QueryClient } from './types-B0i0SaOM.js';
import './removable.js';
import './subscribable.js';
import './subscribable.js';
export { aQ as NotifyOptions, aP as ObserverFetchOptions, c as QueryObserver } from './types-Br-AgPmc.js';
export { aQ as NotifyOptions, aP as ObserverFetchOptions, c as QueryObserver } from './types-B0i0SaOM.js';
import './removable.js';

@@ -1,3 +0,3 @@

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';
export { C as CancelledError, bf as RetryDelayValue, be as RetryValue, bd as Retryer, bg as canFetch, bh as createRetryer, l as isCancelledError } from './types-B0i0SaOM.js';
import './removable.js';
import './subscribable.js';

@@ -1,3 +0,3 @@

export { aK as CancelOptions, 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, ax as MutationFunction, at as MutationKey, aw as MutationMeta, 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, 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, aI as QueryClientConfig, w as QueryFunction, y as QueryFunctionContext, t as QueryKey, A as QueryKeyHashFunction, F as QueryMeta, 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, ab as QueryStatus, a4 as RefetchOptions, a6 as RefetchQueryFilters, R as Register, a8 as ResetOptions, a3 as ResultOptions, aL as SetDataOptions, V as ThrowOnError, X as WithRequired, u as dataTagSymbol } from './types-Br-AgPmc.js';
export { aK as CancelOptions, 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, ax as MutationFunction, at as MutationKey, aw as MutationMeta, 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, 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, aI as QueryClientConfig, w as QueryFunction, y as QueryFunctionContext, t as QueryKey, A as QueryKeyHashFunction, F as QueryMeta, 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, ab as QueryStatus, a4 as RefetchOptions, a6 as RefetchQueryFilters, R as Register, a8 as ResetOptions, a3 as ResultOptions, aL as SetDataOptions, V as ThrowOnError, X as WithRequired, u as dataTagSymbol } from './types-B0i0SaOM.js';
import './removable.js';
import './subscribable.js';

@@ -1,3 +0,3 @@

export { g as MutationFilters, j as QueryFilters, aY as QueryTypeFilter, S as SkipToken, U as Updater, b8 as addToEnd, b9 as addToStart, a_ as functionalUpdate, h as hashKey, b1 as hashQueryKeyByOptions, b4 as isPlainArray, b5 as isPlainObject, i as isServer, a$ as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, aZ as noop, b2 as partialMatchKey, b7 as replaceData, r as replaceEqualDeep, b3 as shallowEqualObjects, s as skipToken, b6 as sleep, b0 as timeUntilStale } from './types-Br-AgPmc.js';
export { g as MutationFilters, j as QueryFilters, aY as QueryTypeFilter, S as SkipToken, U as Updater, b8 as addToEnd, b9 as addToStart, a_ as functionalUpdate, h as hashKey, b1 as hashQueryKeyByOptions, b4 as isPlainArray, b5 as isPlainObject, i as isServer, a$ as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, aZ as noop, b2 as partialMatchKey, b7 as replaceData, r as replaceEqualDeep, b3 as shallowEqualObjects, s as skipToken, b6 as sleep, b0 as timeUntilStale } from './types-B0i0SaOM.js';
import './removable.js';
import './subscribable.js';
{
"name": "@tanstack/query-core",
"version": "5.35.5",
"version": "5.36.0",
"description": "The framework agnostic core that powers TanStack Query",

@@ -5,0 +5,0 @@ "author": "tannerlinsley",

@@ -13,2 +13,3 @@ import { QueryObserver } from './queryObserver'

InfiniteData,
InfiniteQueryObserverBaseResult,
InfiniteQueryObserverOptions,

@@ -149,14 +150,15 @@ InfiniteQueryObserverResult,

const { state } = query
const result = super.createResult(query, options)
const parentResult = super.createResult(query, options)
const { isFetching, isRefetching } = result
const { isFetching, isRefetching, isError, isRefetchError } = parentResult
const fetchDirection = state.fetchMeta?.fetchMore?.direction
const isFetchingNextPage =
isFetching && state.fetchMeta?.fetchMore?.direction === 'forward'
const isFetchNextPageError = isError && fetchDirection === 'forward'
const isFetchingNextPage = isFetching && fetchDirection === 'forward'
const isFetchingPreviousPage =
isFetching && state.fetchMeta?.fetchMore?.direction === 'backward'
const isFetchPreviousPageError = isError && fetchDirection === 'backward'
const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'
return {
...result,
const result: InfiniteQueryObserverBaseResult<TData, TError> = {
...parentResult,
fetchNextPage: this.fetchNextPage,

@@ -166,8 +168,14 @@ fetchPreviousPage: this.fetchPreviousPage,

hasPreviousPage: hasPreviousPage(options, state.data),
isFetchNextPageError,
isFetchingNextPage,
isFetchPreviousPageError,
isFetchingPreviousPage,
isRefetchError:
isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,
isRefetching:
isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,
}
return result as InfiniteQueryObserverResult<TData, TError>
}
}

@@ -476,2 +476,9 @@ /* istanbul ignore file */

export interface RefetchOptions extends ResultOptions {
/**
* If set to `true`, a currently running request will be cancelled before a new request is made
*
* If set to `false`, no refetch will be made if there is already a request running.
*
* Defaults to `true`.
*/
cancelRefetch?: boolean

@@ -490,2 +497,10 @@ }

export interface FetchNextPageOptions extends ResultOptions {
/**
* If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,
* whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.
*
* If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.
*
* Defaults to `true`.
*/
cancelRefetch?: boolean

@@ -495,2 +510,10 @@ }

export interface FetchPreviousPageOptions extends ResultOptions {
/**
* If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,
* whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.
*
* If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.
*
* Defaults to `true`.
*/
cancelRefetch?: boolean

@@ -718,11 +741,37 @@ }

> extends QueryObserverBaseResult<TData, TError> {
/**
* This function allows you to fetch the next "page" of results.
*/
fetchNextPage: (
options?: FetchNextPageOptions,
) => Promise<InfiniteQueryObserverResult<TData, TError>>
/**
* This function allows you to fetch the previous "page" of results.
*/
fetchPreviousPage: (
options?: FetchPreviousPageOptions,
) => Promise<InfiniteQueryObserverResult<TData, TError>>
/**
* Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).
*/
hasNextPage: boolean
/**
* Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).
*/
hasPreviousPage: boolean
/**
* Will be `true` if the query failed while fetching the next page.
*/
isFetchNextPageError: boolean
/**
* Will be `true` while fetching the next page with `fetchNextPage`.
*/
isFetchingNextPage: boolean
/**
* Will be `true` if the query failed while fetching the previous page.
*/
isFetchPreviousPageError: boolean
/**
* Will be `true` while fetching the previous page with `fetchPreviousPage`.
*/
isFetchingPreviousPage: boolean

@@ -741,2 +790,4 @@ }

isRefetchError: false
isFetchNextPageError: false
isFetchPreviousPageError: false
isSuccess: false

@@ -757,2 +808,4 @@ status: 'pending'

isRefetchError: false
isFetchNextPageError: false
isFetchPreviousPageError: false
isSuccess: false

@@ -773,2 +826,4 @@ status: 'pending'

isRefetchError: false
isFetchNextPageError: false
isFetchPreviousPageError: false
isSuccess: false

@@ -789,2 +844,4 @@ status: 'error'

isRefetchError: true
isFetchNextPageError: false
isFetchPreviousPageError: false
isSuccess: false

@@ -805,2 +862,4 @@ status: 'error'

isRefetchError: false
isFetchNextPageError: false
isFetchPreviousPageError: false
isSuccess: true

@@ -807,0 +866,0 @@ status: 'success'

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc