@tanstack/query-core 5.69.0 → 5.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/{hydration-BZgfn3GW.d.cts → hydration-CIqZ2rw6.d.cts} +3 -6
- package/build/legacy/{hydration-B_mC2U5v.d.ts → hydration-Cik0p0G0.d.ts} +3 -6
- package/build/legacy/hydration.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/index.cjs +2 -0
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +2 -2
- package/build/legacy/index.d.ts +2 -2
- package/build/legacy/index.js +2 -1
- package/build/legacy/index.js.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
- package/build/legacy/infiniteQueryObserver.cjs +5 -8
- package/build/legacy/infiniteQueryObserver.cjs.map +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +2 -2
- package/build/legacy/infiniteQueryObserver.d.ts +2 -2
- package/build/legacy/infiniteQueryObserver.js +5 -8
- package/build/legacy/infiniteQueryObserver.js.map +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/notifyManager.cjs +4 -1
- package/build/legacy/notifyManager.cjs.map +1 -1
- package/build/legacy/notifyManager.d.cts +2 -1
- package/build/legacy/notifyManager.d.ts +2 -1
- package/build/legacy/notifyManager.js +3 -1
- package/build/legacy/notifyManager.js.map +1 -1
- package/build/legacy/queriesObserver.cjs +2 -2
- package/build/legacy/queriesObserver.cjs.map +1 -1
- package/build/legacy/queriesObserver.d.cts +2 -2
- package/build/legacy/queriesObserver.d.ts +2 -2
- package/build/legacy/queriesObserver.js +2 -2
- package/build/legacy/queriesObserver.js.map +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.cjs +4 -8
- package/build/legacy/queryObserver.cjs.map +1 -1
- package/build/legacy/queryObserver.d.cts +1 -1
- package/build/legacy/queryObserver.d.ts +1 -1
- package/build/legacy/queryObserver.js +4 -8
- package/build/legacy/queryObserver.js.map +1 -1
- package/build/legacy/retryer.d.cts +1 -1
- package/build/legacy/retryer.d.ts +1 -1
- package/build/legacy/streamedQuery.d.cts +1 -1
- package/build/legacy/streamedQuery.d.ts +1 -1
- package/build/legacy/types.d.cts +1 -1
- package/build/legacy/types.d.ts +1 -1
- package/build/legacy/utils.d.cts +1 -1
- package/build/legacy/utils.d.ts +1 -1
- package/build/modern/{hydration-BZgfn3GW.d.cts → hydration-CIqZ2rw6.d.cts} +3 -6
- package/build/modern/{hydration-B_mC2U5v.d.ts → hydration-Cik0p0G0.d.ts} +3 -6
- package/build/modern/hydration.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/index.cjs +2 -0
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +2 -2
- package/build/modern/index.d.ts +2 -2
- package/build/modern/index.js +2 -1
- package/build/modern/index.js.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -1
- package/build/modern/infiniteQueryObserver.cjs +5 -8
- package/build/modern/infiniteQueryObserver.cjs.map +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +2 -2
- package/build/modern/infiniteQueryObserver.d.ts +2 -2
- package/build/modern/infiniteQueryObserver.js +5 -8
- package/build/modern/infiniteQueryObserver.js.map +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/notifyManager.cjs +4 -1
- package/build/modern/notifyManager.cjs.map +1 -1
- package/build/modern/notifyManager.d.cts +2 -1
- package/build/modern/notifyManager.d.ts +2 -1
- package/build/modern/notifyManager.js +3 -1
- package/build/modern/notifyManager.js.map +1 -1
- package/build/modern/queriesObserver.cjs +2 -2
- package/build/modern/queriesObserver.cjs.map +1 -1
- package/build/modern/queriesObserver.d.cts +2 -2
- package/build/modern/queriesObserver.d.ts +2 -2
- package/build/modern/queriesObserver.js +2 -2
- package/build/modern/queriesObserver.js.map +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.cjs +4 -8
- package/build/modern/queryObserver.cjs.map +1 -1
- package/build/modern/queryObserver.d.cts +1 -1
- package/build/modern/queryObserver.d.ts +1 -1
- package/build/modern/queryObserver.js +4 -8
- package/build/modern/queryObserver.js.map +1 -1
- package/build/modern/retryer.d.cts +1 -1
- package/build/modern/retryer.d.ts +1 -1
- package/build/modern/streamedQuery.d.cts +1 -1
- package/build/modern/streamedQuery.d.ts +1 -1
- package/build/modern/types.d.cts +1 -1
- package/build/modern/types.d.ts +1 -1
- package/build/modern/utils.d.cts +1 -1
- package/build/modern/utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/infiniteQueryObserver.ts +4 -9
- package/src/notifyManager.ts +3 -1
- package/src/queriesObserver.ts +1 -3
- package/src/queryObserver.ts +4 -16
|
@@ -2,9 +2,6 @@ import { Removable } from './removable.cjs';
|
|
|
2
2
|
import { Subscribable } from './subscribable.cjs';
|
|
3
3
|
|
|
4
4
|
type QueryObserverListener<TData, TError> = (result: QueryObserverResult<TData, TError>) => void;
|
|
5
|
-
interface NotifyOptions {
|
|
6
|
-
listeners?: boolean;
|
|
7
|
-
}
|
|
8
5
|
interface ObserverFetchOptions extends FetchOptions {
|
|
9
6
|
throwOnError?: boolean;
|
|
10
7
|
}
|
|
@@ -18,7 +15,7 @@ declare class QueryObserver<TQueryFnData = unknown, TError = DefaultError, TData
|
|
|
18
15
|
shouldFetchOnReconnect(): boolean;
|
|
19
16
|
shouldFetchOnWindowFocus(): boolean;
|
|
20
17
|
destroy(): void;
|
|
21
|
-
setOptions(options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey
|
|
18
|
+
setOptions(options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): void;
|
|
22
19
|
getOptimisticResult(options: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): QueryObserverResult<TData, TError>;
|
|
23
20
|
getCurrentResult(): QueryObserverResult<TData, TError>;
|
|
24
21
|
trackResult(result: QueryObserverResult<TData, TError>, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult<TData, TError>;
|
|
@@ -28,7 +25,7 @@ declare class QueryObserver<TQueryFnData = unknown, TError = DefaultError, TData
|
|
|
28
25
|
fetchOptimistic(options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): Promise<QueryObserverResult<TData, TError>>;
|
|
29
26
|
protected fetch(fetchOptions: ObserverFetchOptions): Promise<QueryObserverResult<TData, TError>>;
|
|
30
27
|
protected createResult(query: Query<TQueryFnData, TError, TQueryData, TQueryKey>, options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): QueryObserverResult<TData, TError>;
|
|
31
|
-
updateResult(
|
|
28
|
+
updateResult(): void;
|
|
32
29
|
onQueryUpdate(): void;
|
|
33
30
|
}
|
|
34
31
|
|
|
@@ -1353,4 +1350,4 @@ declare function defaultshouldRedactErrors(_: unknown): boolean;
|
|
|
1353
1350
|
declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState;
|
|
1354
1351
|
declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void;
|
|
1355
1352
|
|
|
1356
|
-
export { type QueryKeyHashFunction as $, type QueryKey as A, dataTagSymbol as B, CancelledError as C, type DehydrateOptions as D, dataTagErrorSymbol as E, unsetMarker as F, type UnsetMarker as G, type HydrateOptions as H, type AnyDataTag as I, type DataTag as J, type InferDataFromTag as K, type InferErrorFromTag as L, MutationCache as M, type NoInfer as N, type OmitKeyof as O, type QueryFunction as P, QueryCache as Q, type Register as R, type SkipToken as S, type StaleTime as T, type Updater as U, type Enabled as V, type QueryPersister as W, type QueryFunctionContext as X, type InitialDataFunction as Y, type PlaceholderDataFunction as Z, type QueriesPlaceholderDataFunction as _, type QueryCacheNotifyEvent as a, type QueryClientConfig as a$, type GetPreviousPageParamFunction as a0, type GetNextPageParamFunction as a1, type InfiniteData as a2, type QueryMeta as a3, type NetworkMode as a4, type NotifyOnChangeProps as a5, type QueryOptions as a6, type InitialPageParam as a7, type InfiniteQueryPageParamsOptions as a8, type ThrowOnError as a9, type QueryObserverPlaceholderResult as aA, type DefinedQueryObserverResult as aB, type QueryObserverResult as aC, type InfiniteQueryObserverBaseResult as aD, type InfiniteQueryObserverPendingResult as aE, type InfiniteQueryObserverLoadingResult as aF, type InfiniteQueryObserverLoadingErrorResult as aG, type InfiniteQueryObserverRefetchErrorResult as aH, type InfiniteQueryObserverSuccessResult as aI, type InfiniteQueryObserverPlaceholderResult as aJ, type DefinedInfiniteQueryObserverResult as aK, type InfiniteQueryObserverResult as aL, type MutationKey as aM, type MutationStatus as aN, type MutationScope as aO, type MutationMeta as aP, type MutationFunction as aQ, type MutationOptions as aR, type MutationObserverOptions as aS, type MutateOptions as aT, type MutateFunction as aU, type MutationObserverBaseResult as aV, type MutationObserverIdleResult as aW, type MutationObserverLoadingResult as aX, type MutationObserverErrorResult as aY, type MutationObserverSuccessResult as aZ, type MutationObserverResult as a_, type QueryObserverOptions as aa, type WithRequired as ab, type Optional as ac, type DefaultedQueryObserverOptions as ad, type InfiniteQueryObserverOptions as ae, type DefaultedInfiniteQueryObserverOptions as af, type FetchQueryOptions as ag, type EnsureQueryDataOptions as ah, type EnsureInfiniteQueryDataOptions as ai, type FetchInfiniteQueryOptions as aj, type ResultOptions as ak, type RefetchOptions as al, type InvalidateQueryFilters as am, type RefetchQueryFilters as an, type InvalidateOptions as ao, type ResetOptions as ap, type FetchNextPageOptions as aq, type FetchPreviousPageOptions as ar, type QueryStatus as as, type FetchStatus as at, type QueryObserverBaseResult as au, type QueryObserverPendingResult as av, type QueryObserverLoadingResult as aw, type QueryObserverLoadingErrorResult as ax, type QueryObserverRefetchErrorResult as ay, type QueryObserverSuccessResult as az, QueryClient as b, type DefaultOptions as b0, type CancelOptions as b1, type SetDataOptions as b2, type NotifyEventType as b3, type NotifyEvent as b4, type QueryBehavior as b5, type
|
|
1353
|
+
export { type QueryKeyHashFunction as $, type QueryKey as A, dataTagSymbol as B, CancelledError as C, type DehydrateOptions as D, dataTagErrorSymbol as E, unsetMarker as F, type UnsetMarker as G, type HydrateOptions as H, type AnyDataTag as I, type DataTag as J, type InferDataFromTag as K, type InferErrorFromTag as L, MutationCache as M, type NoInfer as N, type OmitKeyof as O, type QueryFunction as P, QueryCache as Q, type Register as R, type SkipToken as S, type StaleTime as T, type Updater as U, type Enabled as V, type QueryPersister as W, type QueryFunctionContext as X, type InitialDataFunction as Y, type PlaceholderDataFunction as Z, type QueriesPlaceholderDataFunction as _, type QueryCacheNotifyEvent as a, type QueryClientConfig as a$, type GetPreviousPageParamFunction as a0, type GetNextPageParamFunction as a1, type InfiniteData as a2, type QueryMeta as a3, type NetworkMode as a4, type NotifyOnChangeProps as a5, type QueryOptions as a6, type InitialPageParam as a7, type InfiniteQueryPageParamsOptions as a8, type ThrowOnError as a9, type QueryObserverPlaceholderResult as aA, type DefinedQueryObserverResult as aB, type QueryObserverResult as aC, type InfiniteQueryObserverBaseResult as aD, type InfiniteQueryObserverPendingResult as aE, type InfiniteQueryObserverLoadingResult as aF, type InfiniteQueryObserverLoadingErrorResult as aG, type InfiniteQueryObserverRefetchErrorResult as aH, type InfiniteQueryObserverSuccessResult as aI, type InfiniteQueryObserverPlaceholderResult as aJ, type DefinedInfiniteQueryObserverResult as aK, type InfiniteQueryObserverResult as aL, type MutationKey as aM, type MutationStatus as aN, type MutationScope as aO, type MutationMeta as aP, type MutationFunction as aQ, type MutationOptions as aR, type MutationObserverOptions as aS, type MutateOptions as aT, type MutateFunction as aU, type MutationObserverBaseResult as aV, type MutationObserverIdleResult as aW, type MutationObserverLoadingResult as aX, type MutationObserverErrorResult as aY, type MutationObserverSuccessResult as aZ, type MutationObserverResult as a_, type QueryObserverOptions as aa, type WithRequired as ab, type Optional as ac, type DefaultedQueryObserverOptions as ad, type InfiniteQueryObserverOptions as ae, type DefaultedInfiniteQueryObserverOptions as af, type FetchQueryOptions as ag, type EnsureQueryDataOptions as ah, type EnsureInfiniteQueryDataOptions as ai, type FetchInfiniteQueryOptions as aj, type ResultOptions as ak, type RefetchOptions as al, type InvalidateQueryFilters as am, type RefetchQueryFilters as an, type InvalidateOptions as ao, type ResetOptions as ap, type FetchNextPageOptions as aq, type FetchPreviousPageOptions as ar, type QueryStatus as as, type FetchStatus as at, type QueryObserverBaseResult as au, type QueryObserverPendingResult as av, type QueryObserverLoadingResult as aw, type QueryObserverLoadingErrorResult as ax, type QueryObserverRefetchErrorResult as ay, type QueryObserverSuccessResult as az, QueryClient as b, type DefaultOptions as b0, type CancelOptions as b1, type SetDataOptions as b2, type NotifyEventType as b3, type NotifyEvent as b4, type QueryBehavior as b5, type FetchContext as b6, type FetchDirection as b7, type FetchMeta as b8, type FetchOptions as b9, canFetch as bA, createRetryer as bB, defaultshouldRedactErrors as bC, type Action$1 as ba, type SetStateOptions as bb, fetchState as bc, type Action as bd, getDefaultState as be, type QueryTypeFilter as bf, noop as bg, functionalUpdate as bh, isValidTimeout as bi, timeUntilStale as bj, resolveStaleTime as bk, resolveEnabled as bl, hashQueryKeyByOptions as bm, partialMatchKey as bn, shallowEqualObjects as bo, isPlainArray as bp, isPlainObject as bq, sleep as br, replaceData as bs, addToEnd as bt, addToStart as bu, ensureQueryFn as bv, type QueryStore as bw, type Retryer as bx, type RetryValue as by, type RetryDelayValue as bz, QueryObserver as c, type MutationCacheNotifyEvent as d, MutationObserver as e, matchMutation as f, type MutationFilters as g, hashKey as h, isServer as i, type QueryFilters as j, keepPreviousData as k, isCancelledError as l, matchQuery as m, dehydrate as n, hydrate as o, defaultShouldDehydrateQuery as p, defaultShouldDehydrateMutation as q, replaceEqualDeep as r, skipToken as s, type QueryState as t, Query as u, type MutationState as v, Mutation as w, type DehydratedState as x, type Override as y, type DefaultError as z };
|
|
@@ -2,9 +2,6 @@ import { Removable } from './removable.js';
|
|
|
2
2
|
import { Subscribable } from './subscribable.js';
|
|
3
3
|
|
|
4
4
|
type QueryObserverListener<TData, TError> = (result: QueryObserverResult<TData, TError>) => void;
|
|
5
|
-
interface NotifyOptions {
|
|
6
|
-
listeners?: boolean;
|
|
7
|
-
}
|
|
8
5
|
interface ObserverFetchOptions extends FetchOptions {
|
|
9
6
|
throwOnError?: boolean;
|
|
10
7
|
}
|
|
@@ -18,7 +15,7 @@ declare class QueryObserver<TQueryFnData = unknown, TError = DefaultError, TData
|
|
|
18
15
|
shouldFetchOnReconnect(): boolean;
|
|
19
16
|
shouldFetchOnWindowFocus(): boolean;
|
|
20
17
|
destroy(): void;
|
|
21
|
-
setOptions(options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey
|
|
18
|
+
setOptions(options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): void;
|
|
22
19
|
getOptimisticResult(options: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): QueryObserverResult<TData, TError>;
|
|
23
20
|
getCurrentResult(): QueryObserverResult<TData, TError>;
|
|
24
21
|
trackResult(result: QueryObserverResult<TData, TError>, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult<TData, TError>;
|
|
@@ -28,7 +25,7 @@ declare class QueryObserver<TQueryFnData = unknown, TError = DefaultError, TData
|
|
|
28
25
|
fetchOptimistic(options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): Promise<QueryObserverResult<TData, TError>>;
|
|
29
26
|
protected fetch(fetchOptions: ObserverFetchOptions): Promise<QueryObserverResult<TData, TError>>;
|
|
30
27
|
protected createResult(query: Query<TQueryFnData, TError, TQueryData, TQueryKey>, options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): QueryObserverResult<TData, TError>;
|
|
31
|
-
updateResult(
|
|
28
|
+
updateResult(): void;
|
|
32
29
|
onQueryUpdate(): void;
|
|
33
30
|
}
|
|
34
31
|
|
|
@@ -1353,4 +1350,4 @@ declare function defaultshouldRedactErrors(_: unknown): boolean;
|
|
|
1353
1350
|
declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState;
|
|
1354
1351
|
declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void;
|
|
1355
1352
|
|
|
1356
|
-
export { type QueryKeyHashFunction as $, type QueryKey as A, dataTagSymbol as B, CancelledError as C, type DehydrateOptions as D, dataTagErrorSymbol as E, unsetMarker as F, type UnsetMarker as G, type HydrateOptions as H, type AnyDataTag as I, type DataTag as J, type InferDataFromTag as K, type InferErrorFromTag as L, MutationCache as M, type NoInfer as N, type OmitKeyof as O, type QueryFunction as P, QueryCache as Q, type Register as R, type SkipToken as S, type StaleTime as T, type Updater as U, type Enabled as V, type QueryPersister as W, type QueryFunctionContext as X, type InitialDataFunction as Y, type PlaceholderDataFunction as Z, type QueriesPlaceholderDataFunction as _, type QueryCacheNotifyEvent as a, type QueryClientConfig as a$, type GetPreviousPageParamFunction as a0, type GetNextPageParamFunction as a1, type InfiniteData as a2, type QueryMeta as a3, type NetworkMode as a4, type NotifyOnChangeProps as a5, type QueryOptions as a6, type InitialPageParam as a7, type InfiniteQueryPageParamsOptions as a8, type ThrowOnError as a9, type QueryObserverPlaceholderResult as aA, type DefinedQueryObserverResult as aB, type QueryObserverResult as aC, type InfiniteQueryObserverBaseResult as aD, type InfiniteQueryObserverPendingResult as aE, type InfiniteQueryObserverLoadingResult as aF, type InfiniteQueryObserverLoadingErrorResult as aG, type InfiniteQueryObserverRefetchErrorResult as aH, type InfiniteQueryObserverSuccessResult as aI, type InfiniteQueryObserverPlaceholderResult as aJ, type DefinedInfiniteQueryObserverResult as aK, type InfiniteQueryObserverResult as aL, type MutationKey as aM, type MutationStatus as aN, type MutationScope as aO, type MutationMeta as aP, type MutationFunction as aQ, type MutationOptions as aR, type MutationObserverOptions as aS, type MutateOptions as aT, type MutateFunction as aU, type MutationObserverBaseResult as aV, type MutationObserverIdleResult as aW, type MutationObserverLoadingResult as aX, type MutationObserverErrorResult as aY, type MutationObserverSuccessResult as aZ, type MutationObserverResult as a_, type QueryObserverOptions as aa, type WithRequired as ab, type Optional as ac, type DefaultedQueryObserverOptions as ad, type InfiniteQueryObserverOptions as ae, type DefaultedInfiniteQueryObserverOptions as af, type FetchQueryOptions as ag, type EnsureQueryDataOptions as ah, type EnsureInfiniteQueryDataOptions as ai, type FetchInfiniteQueryOptions as aj, type ResultOptions as ak, type RefetchOptions as al, type InvalidateQueryFilters as am, type RefetchQueryFilters as an, type InvalidateOptions as ao, type ResetOptions as ap, type FetchNextPageOptions as aq, type FetchPreviousPageOptions as ar, type QueryStatus as as, type FetchStatus as at, type QueryObserverBaseResult as au, type QueryObserverPendingResult as av, type QueryObserverLoadingResult as aw, type QueryObserverLoadingErrorResult as ax, type QueryObserverRefetchErrorResult as ay, type QueryObserverSuccessResult as az, QueryClient as b, type DefaultOptions as b0, type CancelOptions as b1, type SetDataOptions as b2, type NotifyEventType as b3, type NotifyEvent as b4, type QueryBehavior as b5, type
|
|
1353
|
+
export { type QueryKeyHashFunction as $, type QueryKey as A, dataTagSymbol as B, CancelledError as C, type DehydrateOptions as D, dataTagErrorSymbol as E, unsetMarker as F, type UnsetMarker as G, type HydrateOptions as H, type AnyDataTag as I, type DataTag as J, type InferDataFromTag as K, type InferErrorFromTag as L, MutationCache as M, type NoInfer as N, type OmitKeyof as O, type QueryFunction as P, QueryCache as Q, type Register as R, type SkipToken as S, type StaleTime as T, type Updater as U, type Enabled as V, type QueryPersister as W, type QueryFunctionContext as X, type InitialDataFunction as Y, type PlaceholderDataFunction as Z, type QueriesPlaceholderDataFunction as _, type QueryCacheNotifyEvent as a, type QueryClientConfig as a$, type GetPreviousPageParamFunction as a0, type GetNextPageParamFunction as a1, type InfiniteData as a2, type QueryMeta as a3, type NetworkMode as a4, type NotifyOnChangeProps as a5, type QueryOptions as a6, type InitialPageParam as a7, type InfiniteQueryPageParamsOptions as a8, type ThrowOnError as a9, type QueryObserverPlaceholderResult as aA, type DefinedQueryObserverResult as aB, type QueryObserverResult as aC, type InfiniteQueryObserverBaseResult as aD, type InfiniteQueryObserverPendingResult as aE, type InfiniteQueryObserverLoadingResult as aF, type InfiniteQueryObserverLoadingErrorResult as aG, type InfiniteQueryObserverRefetchErrorResult as aH, type InfiniteQueryObserverSuccessResult as aI, type InfiniteQueryObserverPlaceholderResult as aJ, type DefinedInfiniteQueryObserverResult as aK, type InfiniteQueryObserverResult as aL, type MutationKey as aM, type MutationStatus as aN, type MutationScope as aO, type MutationMeta as aP, type MutationFunction as aQ, type MutationOptions as aR, type MutationObserverOptions as aS, type MutateOptions as aT, type MutateFunction as aU, type MutationObserverBaseResult as aV, type MutationObserverIdleResult as aW, type MutationObserverLoadingResult as aX, type MutationObserverErrorResult as aY, type MutationObserverSuccessResult as aZ, type MutationObserverResult as a_, type QueryObserverOptions as aa, type WithRequired as ab, type Optional as ac, type DefaultedQueryObserverOptions as ad, type InfiniteQueryObserverOptions as ae, type DefaultedInfiniteQueryObserverOptions as af, type FetchQueryOptions as ag, type EnsureQueryDataOptions as ah, type EnsureInfiniteQueryDataOptions as ai, type FetchInfiniteQueryOptions as aj, type ResultOptions as ak, type RefetchOptions as al, type InvalidateQueryFilters as am, type RefetchQueryFilters as an, type InvalidateOptions as ao, type ResetOptions as ap, type FetchNextPageOptions as aq, type FetchPreviousPageOptions as ar, type QueryStatus as as, type FetchStatus as at, type QueryObserverBaseResult as au, type QueryObserverPendingResult as av, type QueryObserverLoadingResult as aw, type QueryObserverLoadingErrorResult as ax, type QueryObserverRefetchErrorResult as ay, type QueryObserverSuccessResult as az, QueryClient as b, type DefaultOptions as b0, type CancelOptions as b1, type SetDataOptions as b2, type NotifyEventType as b3, type NotifyEvent as b4, type QueryBehavior as b5, type FetchContext as b6, type FetchDirection as b7, type FetchMeta as b8, type FetchOptions as b9, canFetch as bA, createRetryer as bB, defaultshouldRedactErrors as bC, type Action$1 as ba, type SetStateOptions as bb, fetchState as bc, type Action as bd, getDefaultState as be, type QueryTypeFilter as bf, noop as bg, functionalUpdate as bh, isValidTimeout as bi, timeUntilStale as bj, resolveStaleTime as bk, resolveEnabled as bl, hashQueryKeyByOptions as bm, partialMatchKey as bn, shallowEqualObjects as bo, isPlainArray as bp, isPlainObject as bq, sleep as br, replaceData as bs, addToEnd as bt, addToStart as bu, ensureQueryFn as bv, type QueryStore as bw, type Retryer as bx, type RetryValue as by, type RetryDelayValue as bz, QueryObserver as c, type MutationCacheNotifyEvent as d, MutationObserver as e, matchMutation as f, type MutationFilters as g, hashKey as h, isServer as i, type QueryFilters as j, keepPreviousData as k, isCancelledError as l, matchQuery as m, dehydrate as n, hydrate as o, defaultShouldDehydrateQuery as p, defaultShouldDehydrateMutation as q, replaceEqualDeep as r, skipToken as s, type QueryState as t, Query as u, type MutationState as v, Mutation as w, type DehydratedState as x, type Override as y, type DefaultError as z };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery,
|
|
1
|
+
export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, bC as defaultshouldRedactErrors, n as dehydrate, o as hydrate } from './hydration-CIqZ2rw6.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery,
|
|
1
|
+
export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, bC as defaultshouldRedactErrors, n as dehydrate, o as hydrate } from './hydration-Cik0p0G0.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
package/build/legacy/index.cjs
CHANGED
|
@@ -31,6 +31,7 @@ __export(src_exports, {
|
|
|
31
31
|
QueryCache: () => import_queryCache.QueryCache,
|
|
32
32
|
QueryClient: () => import_queryClient.QueryClient,
|
|
33
33
|
QueryObserver: () => import_queryObserver.QueryObserver,
|
|
34
|
+
defaultScheduler: () => import_notifyManager.defaultScheduler,
|
|
34
35
|
defaultShouldDehydrateMutation: () => import_hydration.defaultShouldDehydrateMutation,
|
|
35
36
|
defaultShouldDehydrateQuery: () => import_hydration.defaultShouldDehydrateQuery,
|
|
36
37
|
dehydrate: () => import_hydration.dehydrate,
|
|
@@ -79,6 +80,7 @@ var import_mutation = require("./mutation.cjs");
|
|
|
79
80
|
QueryCache,
|
|
80
81
|
QueryClient,
|
|
81
82
|
QueryObserver,
|
|
83
|
+
defaultScheduler,
|
|
82
84
|
defaultShouldDehydrateMutation,
|
|
83
85
|
defaultShouldDehydrateQuery,
|
|
84
86
|
dehydrate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { CancelledError } from './retryer'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { QueriesObserver } from './queriesObserver'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { notifyManager } from './notifyManager'\nexport { focusManager } from './focusManager'\nexport { onlineManager } from './onlineManager'\nexport {\n hashKey,\n replaceEqualDeep,\n isServer,\n matchQuery,\n matchMutation,\n keepPreviousData,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, Updater, SkipToken } from './utils'\nexport { isCancelledError } from './retryer'\nexport {\n dehydrate,\n hydrate,\n defaultShouldDehydrateQuery,\n defaultShouldDehydrateMutation,\n} from './hydration'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport * from './types'\nexport type { QueryState } from './query'\nexport { Query } from './query'\nexport type { MutationState } from './mutation'\nexport { Mutation } from './mutation'\nexport type {\n DehydrateOptions,\n DehydratedState,\n HydrateOptions,\n} from './hydration'\nexport type { QueriesObserverOptions } from './queriesObserver'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAA+B;AAC/B,wBAA2B;AAE3B,yBAA4B;AAC5B,2BAA8B;AAC9B,6BAAgC;AAChC,mCAAsC;AACtC,2BAA8B;AAE9B,8BAAiC;AACjC,
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { CancelledError } from './retryer'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { QueriesObserver } from './queriesObserver'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { notifyManager, defaultScheduler } from './notifyManager'\nexport { focusManager } from './focusManager'\nexport { onlineManager } from './onlineManager'\nexport {\n hashKey,\n replaceEqualDeep,\n isServer,\n matchQuery,\n matchMutation,\n keepPreviousData,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, Updater, SkipToken } from './utils'\nexport { isCancelledError } from './retryer'\nexport {\n dehydrate,\n hydrate,\n defaultShouldDehydrateQuery,\n defaultShouldDehydrateMutation,\n} from './hydration'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport * from './types'\nexport type { QueryState } from './query'\nexport { Query } from './query'\nexport type { MutationState } from './mutation'\nexport { Mutation } from './mutation'\nexport type {\n DehydrateOptions,\n DehydratedState,\n HydrateOptions,\n} from './hydration'\nexport type { QueriesObserverOptions } from './queriesObserver'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAA+B;AAC/B,wBAA2B;AAE3B,yBAA4B;AAC5B,2BAA8B;AAC9B,6BAAgC;AAChC,mCAAsC;AACtC,2BAA8B;AAE9B,8BAAiC;AACjC,2BAAgD;AAChD,0BAA6B;AAC7B,2BAA8B;AAC9B,mBAQO;AAEP,IAAAA,kBAAiC;AACjC,uBAKO;AAEP,2BAA4D;AAG5D,wBAAc,wBApCd;AAsCA,mBAAsB;AAEtB,sBAAyB;","names":["import_retryer"]}
|
package/build/legacy/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { I as AnyDataTag, b1 as CancelOptions, C as CancelledError, J as DataTag, z as DefaultError, b0 as DefaultOptions, af as DefaultedInfiniteQueryObserverOptions, ad as DefaultedQueryObserverOptions, aK as DefinedInfiniteQueryObserverResult, aB as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, V as Enabled, ai as EnsureInfiniteQueryDataOptions, ah as EnsureQueryDataOptions, aj as FetchInfiniteQueryOptions, aq as FetchNextPageOptions, ar as FetchPreviousPageOptions, ag as FetchQueryOptions, at as FetchStatus, a1 as GetNextPageParamFunction, a0 as GetPreviousPageParamFunction, H as HydrateOptions, K as InferDataFromTag, L as InferErrorFromTag, a2 as InfiniteData, aD as InfiniteQueryObserverBaseResult, aG as InfiniteQueryObserverLoadingErrorResult, aF as InfiniteQueryObserverLoadingResult, ae as InfiniteQueryObserverOptions, aE as InfiniteQueryObserverPendingResult, aJ as InfiniteQueryObserverPlaceholderResult, aH as InfiniteQueryObserverRefetchErrorResult, aL as InfiniteQueryObserverResult, aI as InfiniteQueryObserverSuccessResult, a8 as InfiniteQueryPageParamsOptions, Y as InitialDataFunction, a7 as InitialPageParam, ao as InvalidateOptions, am as InvalidateQueryFilters, aU as MutateFunction, aT as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aQ as MutationFunction, aM as MutationKey, aP as MutationMeta, e as MutationObserver, aV as MutationObserverBaseResult, aY as MutationObserverErrorResult, aW as MutationObserverIdleResult, aX as MutationObserverLoadingResult, aS as MutationObserverOptions, a_ as MutationObserverResult, aZ as MutationObserverSuccessResult, aR as MutationOptions, aO as MutationScope, v as MutationState, aN as MutationStatus, a4 as NetworkMode, N as NoInfer, b4 as NotifyEvent, b3 as NotifyEventType, a5 as NotifyOnChangeProps, O as OmitKeyof, ac as Optional, y as Override, Z as PlaceholderDataFunction, _ as QueriesPlaceholderDataFunction, u as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, a$ as QueryClientConfig, j as QueryFilters, P as QueryFunction, X as QueryFunctionContext, A as QueryKey, $ as QueryKeyHashFunction, a3 as QueryMeta, c as QueryObserver, au as QueryObserverBaseResult, ax as QueryObserverLoadingErrorResult, aw as QueryObserverLoadingResult, aa as QueryObserverOptions, av as QueryObserverPendingResult, aA as QueryObserverPlaceholderResult, ay as QueryObserverRefetchErrorResult, aC as QueryObserverResult, az as QueryObserverSuccessResult, a6 as QueryOptions, W as QueryPersister, t as QueryState, as as QueryStatus, al as RefetchOptions, an as RefetchQueryFilters, R as Register, ap as ResetOptions, ak as ResultOptions, b2 as SetDataOptions, S as SkipToken, T as StaleTime, a9 as ThrowOnError, G as UnsetMarker, U as Updater, ab 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-
|
|
1
|
+
export { I as AnyDataTag, b1 as CancelOptions, C as CancelledError, J as DataTag, z as DefaultError, b0 as DefaultOptions, af as DefaultedInfiniteQueryObserverOptions, ad as DefaultedQueryObserverOptions, aK as DefinedInfiniteQueryObserverResult, aB as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, V as Enabled, ai as EnsureInfiniteQueryDataOptions, ah as EnsureQueryDataOptions, aj as FetchInfiniteQueryOptions, aq as FetchNextPageOptions, ar as FetchPreviousPageOptions, ag as FetchQueryOptions, at as FetchStatus, a1 as GetNextPageParamFunction, a0 as GetPreviousPageParamFunction, H as HydrateOptions, K as InferDataFromTag, L as InferErrorFromTag, a2 as InfiniteData, aD as InfiniteQueryObserverBaseResult, aG as InfiniteQueryObserverLoadingErrorResult, aF as InfiniteQueryObserverLoadingResult, ae as InfiniteQueryObserverOptions, aE as InfiniteQueryObserverPendingResult, aJ as InfiniteQueryObserverPlaceholderResult, aH as InfiniteQueryObserverRefetchErrorResult, aL as InfiniteQueryObserverResult, aI as InfiniteQueryObserverSuccessResult, a8 as InfiniteQueryPageParamsOptions, Y as InitialDataFunction, a7 as InitialPageParam, ao as InvalidateOptions, am as InvalidateQueryFilters, aU as MutateFunction, aT as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aQ as MutationFunction, aM as MutationKey, aP as MutationMeta, e as MutationObserver, aV as MutationObserverBaseResult, aY as MutationObserverErrorResult, aW as MutationObserverIdleResult, aX as MutationObserverLoadingResult, aS as MutationObserverOptions, a_ as MutationObserverResult, aZ as MutationObserverSuccessResult, aR as MutationOptions, aO as MutationScope, v as MutationState, aN as MutationStatus, a4 as NetworkMode, N as NoInfer, b4 as NotifyEvent, b3 as NotifyEventType, a5 as NotifyOnChangeProps, O as OmitKeyof, ac as Optional, y as Override, Z as PlaceholderDataFunction, _ as QueriesPlaceholderDataFunction, u as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, a$ as QueryClientConfig, j as QueryFilters, P as QueryFunction, X as QueryFunctionContext, A as QueryKey, $ as QueryKeyHashFunction, a3 as QueryMeta, c as QueryObserver, au as QueryObserverBaseResult, ax as QueryObserverLoadingErrorResult, aw as QueryObserverLoadingResult, aa as QueryObserverOptions, av as QueryObserverPendingResult, aA as QueryObserverPlaceholderResult, ay as QueryObserverRefetchErrorResult, aC as QueryObserverResult, az as QueryObserverSuccessResult, a6 as QueryOptions, W as QueryPersister, t as QueryState, as as QueryStatus, al as RefetchOptions, an as RefetchQueryFilters, R as Register, ap as ResetOptions, ak as ResultOptions, b2 as SetDataOptions, S as SkipToken, T as StaleTime, a9 as ThrowOnError, G as UnsetMarker, U as Updater, ab 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-CIqZ2rw6.cjs';
|
|
2
2
|
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs';
|
|
3
3
|
export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs';
|
|
4
|
-
export { notifyManager } from './notifyManager.cjs';
|
|
4
|
+
export { defaultScheduler, notifyManager } from './notifyManager.cjs';
|
|
5
5
|
export { focusManager } from './focusManager.cjs';
|
|
6
6
|
export { onlineManager } from './onlineManager.cjs';
|
|
7
7
|
export { streamedQuery as experimental_streamedQuery } from './streamedQuery.cjs';
|
package/build/legacy/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { I as AnyDataTag, b1 as CancelOptions, C as CancelledError, J as DataTag, z as DefaultError, b0 as DefaultOptions, af as DefaultedInfiniteQueryObserverOptions, ad as DefaultedQueryObserverOptions, aK as DefinedInfiniteQueryObserverResult, aB as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, V as Enabled, ai as EnsureInfiniteQueryDataOptions, ah as EnsureQueryDataOptions, aj as FetchInfiniteQueryOptions, aq as FetchNextPageOptions, ar as FetchPreviousPageOptions, ag as FetchQueryOptions, at as FetchStatus, a1 as GetNextPageParamFunction, a0 as GetPreviousPageParamFunction, H as HydrateOptions, K as InferDataFromTag, L as InferErrorFromTag, a2 as InfiniteData, aD as InfiniteQueryObserverBaseResult, aG as InfiniteQueryObserverLoadingErrorResult, aF as InfiniteQueryObserverLoadingResult, ae as InfiniteQueryObserverOptions, aE as InfiniteQueryObserverPendingResult, aJ as InfiniteQueryObserverPlaceholderResult, aH as InfiniteQueryObserverRefetchErrorResult, aL as InfiniteQueryObserverResult, aI as InfiniteQueryObserverSuccessResult, a8 as InfiniteQueryPageParamsOptions, Y as InitialDataFunction, a7 as InitialPageParam, ao as InvalidateOptions, am as InvalidateQueryFilters, aU as MutateFunction, aT as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aQ as MutationFunction, aM as MutationKey, aP as MutationMeta, e as MutationObserver, aV as MutationObserverBaseResult, aY as MutationObserverErrorResult, aW as MutationObserverIdleResult, aX as MutationObserverLoadingResult, aS as MutationObserverOptions, a_ as MutationObserverResult, aZ as MutationObserverSuccessResult, aR as MutationOptions, aO as MutationScope, v as MutationState, aN as MutationStatus, a4 as NetworkMode, N as NoInfer, b4 as NotifyEvent, b3 as NotifyEventType, a5 as NotifyOnChangeProps, O as OmitKeyof, ac as Optional, y as Override, Z as PlaceholderDataFunction, _ as QueriesPlaceholderDataFunction, u as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, a$ as QueryClientConfig, j as QueryFilters, P as QueryFunction, X as QueryFunctionContext, A as QueryKey, $ as QueryKeyHashFunction, a3 as QueryMeta, c as QueryObserver, au as QueryObserverBaseResult, ax as QueryObserverLoadingErrorResult, aw as QueryObserverLoadingResult, aa as QueryObserverOptions, av as QueryObserverPendingResult, aA as QueryObserverPlaceholderResult, ay as QueryObserverRefetchErrorResult, aC as QueryObserverResult, az as QueryObserverSuccessResult, a6 as QueryOptions, W as QueryPersister, t as QueryState, as as QueryStatus, al as RefetchOptions, an as RefetchQueryFilters, R as Register, ap as ResetOptions, ak as ResultOptions, b2 as SetDataOptions, S as SkipToken, T as StaleTime, a9 as ThrowOnError, G as UnsetMarker, U as Updater, ab 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-
|
|
1
|
+
export { I as AnyDataTag, b1 as CancelOptions, C as CancelledError, J as DataTag, z as DefaultError, b0 as DefaultOptions, af as DefaultedInfiniteQueryObserverOptions, ad as DefaultedQueryObserverOptions, aK as DefinedInfiniteQueryObserverResult, aB as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, V as Enabled, ai as EnsureInfiniteQueryDataOptions, ah as EnsureQueryDataOptions, aj as FetchInfiniteQueryOptions, aq as FetchNextPageOptions, ar as FetchPreviousPageOptions, ag as FetchQueryOptions, at as FetchStatus, a1 as GetNextPageParamFunction, a0 as GetPreviousPageParamFunction, H as HydrateOptions, K as InferDataFromTag, L as InferErrorFromTag, a2 as InfiniteData, aD as InfiniteQueryObserverBaseResult, aG as InfiniteQueryObserverLoadingErrorResult, aF as InfiniteQueryObserverLoadingResult, ae as InfiniteQueryObserverOptions, aE as InfiniteQueryObserverPendingResult, aJ as InfiniteQueryObserverPlaceholderResult, aH as InfiniteQueryObserverRefetchErrorResult, aL as InfiniteQueryObserverResult, aI as InfiniteQueryObserverSuccessResult, a8 as InfiniteQueryPageParamsOptions, Y as InitialDataFunction, a7 as InitialPageParam, ao as InvalidateOptions, am as InvalidateQueryFilters, aU as MutateFunction, aT as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aQ as MutationFunction, aM as MutationKey, aP as MutationMeta, e as MutationObserver, aV as MutationObserverBaseResult, aY as MutationObserverErrorResult, aW as MutationObserverIdleResult, aX as MutationObserverLoadingResult, aS as MutationObserverOptions, a_ as MutationObserverResult, aZ as MutationObserverSuccessResult, aR as MutationOptions, aO as MutationScope, v as MutationState, aN as MutationStatus, a4 as NetworkMode, N as NoInfer, b4 as NotifyEvent, b3 as NotifyEventType, a5 as NotifyOnChangeProps, O as OmitKeyof, ac as Optional, y as Override, Z as PlaceholderDataFunction, _ as QueriesPlaceholderDataFunction, u as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, a$ as QueryClientConfig, j as QueryFilters, P as QueryFunction, X as QueryFunctionContext, A as QueryKey, $ as QueryKeyHashFunction, a3 as QueryMeta, c as QueryObserver, au as QueryObserverBaseResult, ax as QueryObserverLoadingErrorResult, aw as QueryObserverLoadingResult, aa as QueryObserverOptions, av as QueryObserverPendingResult, aA as QueryObserverPlaceholderResult, ay as QueryObserverRefetchErrorResult, aC as QueryObserverResult, az as QueryObserverSuccessResult, a6 as QueryOptions, W as QueryPersister, t as QueryState, as as QueryStatus, al as RefetchOptions, an as RefetchQueryFilters, R as Register, ap as ResetOptions, ak as ResultOptions, b2 as SetDataOptions, S as SkipToken, T as StaleTime, a9 as ThrowOnError, G as UnsetMarker, U as Updater, ab 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-Cik0p0G0.js';
|
|
2
2
|
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js';
|
|
3
3
|
export { InfiniteQueryObserver } from './infiniteQueryObserver.js';
|
|
4
|
-
export { notifyManager } from './notifyManager.js';
|
|
4
|
+
export { defaultScheduler, notifyManager } from './notifyManager.js';
|
|
5
5
|
export { focusManager } from './focusManager.js';
|
|
6
6
|
export { onlineManager } from './onlineManager.js';
|
|
7
7
|
export { streamedQuery as experimental_streamedQuery } from './streamedQuery.js';
|
package/build/legacy/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { QueriesObserver } from "./queriesObserver.js";
|
|
|
9
9
|
import { InfiniteQueryObserver } from "./infiniteQueryObserver.js";
|
|
10
10
|
import { MutationCache } from "./mutationCache.js";
|
|
11
11
|
import { MutationObserver } from "./mutationObserver.js";
|
|
12
|
-
import { notifyManager } from "./notifyManager.js";
|
|
12
|
+
import { notifyManager, defaultScheduler } from "./notifyManager.js";
|
|
13
13
|
import { focusManager } from "./focusManager.js";
|
|
14
14
|
import { onlineManager } from "./onlineManager.js";
|
|
15
15
|
import {
|
|
@@ -43,6 +43,7 @@ export {
|
|
|
43
43
|
QueryCache,
|
|
44
44
|
QueryClient,
|
|
45
45
|
QueryObserver,
|
|
46
|
+
defaultScheduler,
|
|
46
47
|
defaultShouldDehydrateMutation,
|
|
47
48
|
defaultShouldDehydrateQuery,
|
|
48
49
|
dehydrate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { CancelledError } from './retryer'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { QueriesObserver } from './queriesObserver'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { notifyManager } from './notifyManager'\nexport { focusManager } from './focusManager'\nexport { onlineManager } from './onlineManager'\nexport {\n hashKey,\n replaceEqualDeep,\n isServer,\n matchQuery,\n matchMutation,\n keepPreviousData,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, Updater, SkipToken } from './utils'\nexport { isCancelledError } from './retryer'\nexport {\n dehydrate,\n hydrate,\n defaultShouldDehydrateQuery,\n defaultShouldDehydrateMutation,\n} from './hydration'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport * from './types'\nexport type { QueryState } from './query'\nexport { Query } from './query'\nexport type { MutationState } from './mutation'\nexport { Mutation } from './mutation'\nexport type {\n DehydrateOptions,\n DehydratedState,\n HydrateOptions,\n} from './hydration'\nexport type { QueriesObserverOptions } from './queriesObserver'\n"],"mappings":";;;AAEA,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAE3B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAE9B,SAAS,wBAAwB;AACjC,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { CancelledError } from './retryer'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { QueriesObserver } from './queriesObserver'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { notifyManager, defaultScheduler } from './notifyManager'\nexport { focusManager } from './focusManager'\nexport { onlineManager } from './onlineManager'\nexport {\n hashKey,\n replaceEqualDeep,\n isServer,\n matchQuery,\n matchMutation,\n keepPreviousData,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, Updater, SkipToken } from './utils'\nexport { isCancelledError } from './retryer'\nexport {\n dehydrate,\n hydrate,\n defaultShouldDehydrateQuery,\n defaultShouldDehydrateMutation,\n} from './hydration'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport * from './types'\nexport type { QueryState } from './query'\nexport { Query } from './query'\nexport type { MutationState } from './mutation'\nexport { Mutation } from './mutation'\nexport type {\n DehydrateOptions,\n DehydratedState,\n HydrateOptions,\n} from './hydration'\nexport type { QueriesObserverOptions } from './queriesObserver'\n"],"mappings":";;;AAEA,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAE3B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAE9B,SAAS,wBAAwB;AACjC,SAAS,eAAe,wBAAwB;AAChD,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAA0B,qBAAkC;AAG5D,cAAc;AAEd,SAAS,aAAa;AAEtB,SAAS,gBAAgB;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b5 as QueryBehavior, a2 as InfiniteData, a8 as InfiniteQueryPageParamsOptions } from './hydration-
|
|
1
|
+
import { b5 as QueryBehavior, a2 as InfiniteData, a8 as InfiniteQueryPageParamsOptions } from './hydration-CIqZ2rw6.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b5 as QueryBehavior, a2 as InfiniteData, a8 as InfiniteQueryPageParamsOptions } from './hydration-
|
|
1
|
+
import { b5 as QueryBehavior, a2 as InfiniteData, a8 as InfiniteQueryPageParamsOptions } from './hydration-Cik0p0G0.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
4
4
|
|
|
@@ -34,14 +34,11 @@ var InfiniteQueryObserver = class extends import_queryObserver.QueryObserver {
|
|
|
34
34
|
this.fetchNextPage = this.fetchNextPage.bind(this);
|
|
35
35
|
this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
|
|
36
36
|
}
|
|
37
|
-
setOptions(options
|
|
38
|
-
super.setOptions(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
notifyOptions
|
|
44
|
-
);
|
|
37
|
+
setOptions(options) {
|
|
38
|
+
super.setOptions({
|
|
39
|
+
...options,
|
|
40
|
+
behavior: (0, import_infiniteQueryBehavior.infiniteQueryBehavior)()
|
|
41
|
+
});
|
|
45
42
|
}
|
|
46
43
|
getOptimisticResult(options) {
|
|
47
44
|
options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener<TData, TError> = (\n result: InfiniteQueryObserverResult<TData, TError>,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryData, TPageParam>,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener<TData, TError>\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryData, TPageParam>,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult<TData, TError>\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryData, TPageParam>,\n TQueryKey\n >['fetch'],\n Promise<InfiniteQueryObserverResult<TData, TError>>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult<TData, TError> {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise<InfiniteQueryObserverResult<TData, TError>> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise<InfiniteQueryObserverResult<TData, TError>> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData<TQueryData, TPageParam>,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult<TData, TError> {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult<TData, TError> = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult<TData, TError>\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array<any>) => unknown,\n TReturn,\n> = (...args: Parameters<TFunction>) => TReturn\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,mCAIO;AAoBA,IAAM,wBAAN,cAOG,mCAMR;AAAA,EA8BA,YACE,QACA,SAQA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAQM;AACN,UAAM,WAAW;AAAA,MACf,GAAG;AAAA,MACH,cAAU,oDAAsB;AAAA,IAClC,CAAC;AAAA,EACH;AAAA,EAEA,oBACE,SAQ4C;AAC5C,YAAQ,eAAW,oDAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAQ4C;AA9JhD;AA+JI,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,kBAAiB,iBAAM,cAAN,mBAAiB,cAAjB,mBAA4B;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,iBAAa,0CAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,qBAAiB,8CAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z as DefaultError, a2 as InfiniteData, A as QueryKey, c as QueryObserver, aL as InfiniteQueryObserverResult, b as QueryClient, ae as InfiniteQueryObserverOptions,
|
|
1
|
+
import { z as DefaultError, a2 as InfiniteData, A as QueryKey, c as QueryObserver, aL as InfiniteQueryObserverResult, b as QueryClient, ae as InfiniteQueryObserverOptions, af as DefaultedInfiniteQueryObserverOptions, aq as FetchNextPageOptions, ar as FetchPreviousPageOptions, u as Query } from './hydration-CIqZ2rw6.cjs';
|
|
2
2
|
import { Subscribable } from './subscribable.cjs';
|
|
3
3
|
import './removable.cjs';
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ declare class InfiniteQueryObserver<TQueryFnData = unknown, TError = DefaultErro
|
|
|
9
9
|
protected fetch: ReplaceReturnType<QueryObserver<TQueryFnData, TError, TData, InfiniteData<TQueryData, TPageParam>, TQueryKey>['fetch'], Promise<InfiniteQueryObserverResult<TData, TError>>>;
|
|
10
10
|
constructor(client: QueryClient, options: InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>);
|
|
11
11
|
protected bindMethods(): void;
|
|
12
|
-
setOptions(options: InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam
|
|
12
|
+
setOptions(options: InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>): void;
|
|
13
13
|
getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>): InfiniteQueryObserverResult<TData, TError>;
|
|
14
14
|
fetchNextPage(options?: FetchNextPageOptions): Promise<InfiniteQueryObserverResult<TData, TError>>;
|
|
15
15
|
fetchPreviousPage(options?: FetchPreviousPageOptions): Promise<InfiniteQueryObserverResult<TData, TError>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z as DefaultError, a2 as InfiniteData, A as QueryKey, c as QueryObserver, aL as InfiniteQueryObserverResult, b as QueryClient, ae as InfiniteQueryObserverOptions,
|
|
1
|
+
import { z as DefaultError, a2 as InfiniteData, A as QueryKey, c as QueryObserver, aL as InfiniteQueryObserverResult, b as QueryClient, ae as InfiniteQueryObserverOptions, af as DefaultedInfiniteQueryObserverOptions, aq as FetchNextPageOptions, ar as FetchPreviousPageOptions, u as Query } from './hydration-Cik0p0G0.js';
|
|
2
2
|
import { Subscribable } from './subscribable.js';
|
|
3
3
|
import './removable.js';
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ declare class InfiniteQueryObserver<TQueryFnData = unknown, TError = DefaultErro
|
|
|
9
9
|
protected fetch: ReplaceReturnType<QueryObserver<TQueryFnData, TError, TData, InfiniteData<TQueryData, TPageParam>, TQueryKey>['fetch'], Promise<InfiniteQueryObserverResult<TData, TError>>>;
|
|
10
10
|
constructor(client: QueryClient, options: InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>);
|
|
11
11
|
protected bindMethods(): void;
|
|
12
|
-
setOptions(options: InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam
|
|
12
|
+
setOptions(options: InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>): void;
|
|
13
13
|
getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>): InfiniteQueryObserverResult<TData, TError>;
|
|
14
14
|
fetchNextPage(options?: FetchNextPageOptions): Promise<InfiniteQueryObserverResult<TData, TError>>;
|
|
15
15
|
fetchPreviousPage(options?: FetchPreviousPageOptions): Promise<InfiniteQueryObserverResult<TData, TError>>;
|
|
@@ -16,14 +16,11 @@ var InfiniteQueryObserver = class extends QueryObserver {
|
|
|
16
16
|
this.fetchNextPage = this.fetchNextPage.bind(this);
|
|
17
17
|
this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
|
|
18
18
|
}
|
|
19
|
-
setOptions(options
|
|
20
|
-
super.setOptions(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
notifyOptions
|
|
26
|
-
);
|
|
19
|
+
setOptions(options) {
|
|
20
|
+
super.setOptions({
|
|
21
|
+
...options,
|
|
22
|
+
behavior: infiniteQueryBehavior()
|
|
23
|
+
});
|
|
27
24
|
}
|
|
28
25
|
getOptimisticResult(options) {
|
|
29
26
|
options.behavior = infiniteQueryBehavior();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener<TData, TError> = (\n result: InfiniteQueryObserverResult<TData, TError>,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryData, TPageParam>,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener<TData, TError>\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryData, TPageParam>,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult<TData, TError>\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData<TQueryData, TPageParam>,\n TQueryKey\n >['fetch'],\n Promise<InfiniteQueryObserverResult<TData, TError>>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult<TData, TError> {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise<InfiniteQueryObserverResult<TData, TError>> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise<InfiniteQueryObserverResult<TData, TError>> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData<TQueryData, TPageParam>,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult<TData, TError> {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult<TData, TError> = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult<TData, TError>\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array<any>) => unknown,\n TReturn,\n> = (...args: Parameters<TFunction>) => TReturn\n"],"mappings":";;;AAAA,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoBA,IAAM,wBAAN,cAOG,cAMR;AAAA,EA8BA,YACE,QACA,SAQA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAQM;AACN,UAAM,WAAW;AAAA,MACf,GAAG;AAAA,MACH,UAAU,sBAAsB;AAAA,IAClC,CAAC;AAAA,EACH;AAAA,EAEA,oBACE,SAQ4C;AAC5C,YAAQ,WAAW,sBAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAQ4C;AA9JhD;AA+JI,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,kBAAiB,iBAAM,cAAN,mBAAiB,cAAjB,mBAA4B;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,aAAa,YAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,iBAAiB,gBAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.cjs';
|
|
2
|
-
export {
|
|
2
|
+
export { bd as Action, w as Mutation, v as MutationState, be as getDefaultState } from './hydration-CIqZ2rw6.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.js';
|
|
2
|
-
export {
|
|
2
|
+
export { bd as Action, w as Mutation, v as MutationState, be as getDefaultState } from './hydration-Cik0p0G0.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -21,9 +21,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var notifyManager_exports = {};
|
|
22
22
|
__export(notifyManager_exports, {
|
|
23
23
|
createNotifyManager: () => createNotifyManager,
|
|
24
|
+
defaultScheduler: () => defaultScheduler,
|
|
24
25
|
notifyManager: () => notifyManager
|
|
25
26
|
});
|
|
26
27
|
module.exports = __toCommonJS(notifyManager_exports);
|
|
28
|
+
var defaultScheduler = (cb) => setTimeout(cb, 0);
|
|
27
29
|
function createNotifyManager() {
|
|
28
30
|
let queue = [];
|
|
29
31
|
let transactions = 0;
|
|
@@ -33,7 +35,7 @@ function createNotifyManager() {
|
|
|
33
35
|
let batchNotifyFn = (callback) => {
|
|
34
36
|
callback();
|
|
35
37
|
};
|
|
36
|
-
let scheduleFn =
|
|
38
|
+
let scheduleFn = defaultScheduler;
|
|
37
39
|
const schedule = (callback) => {
|
|
38
40
|
if (transactions) {
|
|
39
41
|
queue.push(callback);
|
|
@@ -104,6 +106,7 @@ var notifyManager = createNotifyManager();
|
|
|
104
106
|
// Annotate the CommonJS export names for ESM import in node:
|
|
105
107
|
0 && (module.exports = {
|
|
106
108
|
createNotifyManager,
|
|
109
|
+
defaultScheduler,
|
|
107
110
|
notifyManager
|
|
108
111
|
});
|
|
109
112
|
//# sourceMappingURL=notifyManager.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport function createNotifyManager() {\n let queue: Array<NotifyCallback> = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn
|
|
1
|
+
{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = (cb) => setTimeout(cb, 0)\n\nexport function createNotifyManager() {\n let queue: Array<NotifyCallback> = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: <T>(callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: <T extends Array<unknown>>(\n callback: BatchCallsCallback<T>,\n ): BatchCallsCallback<T> => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,IAAM,mBAAqC,CAAC,OAAO,WAAW,IAAI,CAAC;AAEnE,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAAa;AAEjB,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]}
|
|
@@ -3,6 +3,7 @@ type NotifyFunction = (callback: () => void) => void;
|
|
|
3
3
|
type BatchNotifyFunction = (callback: () => void) => void;
|
|
4
4
|
type BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void;
|
|
5
5
|
type ScheduleFunction = (callback: () => void) => void;
|
|
6
|
+
declare const defaultScheduler: ScheduleFunction;
|
|
6
7
|
declare function createNotifyManager(): {
|
|
7
8
|
readonly batch: <T>(callback: () => T) => T;
|
|
8
9
|
/**
|
|
@@ -42,4 +43,4 @@ declare const notifyManager: {
|
|
|
42
43
|
readonly setScheduler: (fn: ScheduleFunction) => void;
|
|
43
44
|
};
|
|
44
45
|
|
|
45
|
-
export { createNotifyManager, notifyManager };
|
|
46
|
+
export { createNotifyManager, defaultScheduler, notifyManager };
|
|
@@ -3,6 +3,7 @@ type NotifyFunction = (callback: () => void) => void;
|
|
|
3
3
|
type BatchNotifyFunction = (callback: () => void) => void;
|
|
4
4
|
type BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void;
|
|
5
5
|
type ScheduleFunction = (callback: () => void) => void;
|
|
6
|
+
declare const defaultScheduler: ScheduleFunction;
|
|
6
7
|
declare function createNotifyManager(): {
|
|
7
8
|
readonly batch: <T>(callback: () => T) => T;
|
|
8
9
|
/**
|
|
@@ -42,4 +43,4 @@ declare const notifyManager: {
|
|
|
42
43
|
readonly setScheduler: (fn: ScheduleFunction) => void;
|
|
43
44
|
};
|
|
44
45
|
|
|
45
|
-
export { createNotifyManager, notifyManager };
|
|
46
|
+
export { createNotifyManager, defaultScheduler, notifyManager };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./chunk-2HYBKCYP.js";
|
|
2
2
|
|
|
3
3
|
// src/notifyManager.ts
|
|
4
|
+
var defaultScheduler = (cb) => setTimeout(cb, 0);
|
|
4
5
|
function createNotifyManager() {
|
|
5
6
|
let queue = [];
|
|
6
7
|
let transactions = 0;
|
|
@@ -10,7 +11,7 @@ function createNotifyManager() {
|
|
|
10
11
|
let batchNotifyFn = (callback) => {
|
|
11
12
|
callback();
|
|
12
13
|
};
|
|
13
|
-
let scheduleFn =
|
|
14
|
+
let scheduleFn = defaultScheduler;
|
|
14
15
|
const schedule = (callback) => {
|
|
15
16
|
if (transactions) {
|
|
16
17
|
queue.push(callback);
|
|
@@ -80,6 +81,7 @@ function createNotifyManager() {
|
|
|
80
81
|
var notifyManager = createNotifyManager();
|
|
81
82
|
export {
|
|
82
83
|
createNotifyManager,
|
|
84
|
+
defaultScheduler,
|
|
83
85
|
notifyManager
|
|
84
86
|
};
|
|
85
87
|
//# sourceMappingURL=notifyManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport function createNotifyManager() {\n let queue: Array<NotifyCallback> = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn
|
|
1
|
+
{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = (cb) => setTimeout(cb, 0)\n\nexport function createNotifyManager() {\n let queue: Array<NotifyCallback> = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: <T>(callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: <T extends Array<unknown>>(\n callback: BatchCallsCallback<T>,\n ): BatchCallsCallback<T> => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;AAYO,IAAM,mBAAqC,CAAC,OAAO,WAAW,IAAI,CAAC;AAEnE,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAAa;AAEjB,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]}
|
|
@@ -102,7 +102,7 @@ var QueriesObserver = class extends import_subscribable.Subscribable {
|
|
|
102
102
|
observer.destroy();
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
setQueries(queries, options
|
|
105
|
+
setQueries(queries, options) {
|
|
106
106
|
__privateSet(this, _queries, queries);
|
|
107
107
|
__privateSet(this, _options, options);
|
|
108
108
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -120,7 +120,7 @@ var QueriesObserver = class extends import_subscribable.Subscribable {
|
|
|
120
120
|
const newObserverMatches = __privateMethod(this, _findMatchingObservers, findMatchingObservers_fn).call(this, __privateGet(this, _queries));
|
|
121
121
|
__privateSet(this, _observerMatches, newObserverMatches);
|
|
122
122
|
newObserverMatches.forEach(
|
|
123
|
-
(match) => match.observer.setOptions(match.defaultedQueryOptions
|
|
123
|
+
(match) => match.observer.setOptions(match.defaultedQueryOptions)
|
|
124
124
|
);
|
|
125
125
|
const newObservers = newObserverMatches.map((match) => match.observer);
|
|
126
126
|
const newResult = newObservers.map(
|