@tanstack/query-core 5.74.7 → 5.75.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.
Files changed (92) hide show
  1. package/build/legacy/{hydration-BlEK5ylC.d.ts → hydration-C0rn_HEc.d.ts} +1 -2
  2. package/build/legacy/{hydration-CwYEwyQI.d.cts → hydration-DgVqMV9G.d.cts} +1 -2
  3. package/build/legacy/hydration.d.cts +1 -1
  4. package/build/legacy/hydration.d.ts +1 -1
  5. package/build/legacy/index.d.cts +1 -1
  6. package/build/legacy/index.d.ts +1 -1
  7. package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
  8. package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
  9. package/build/legacy/infiniteQueryObserver.d.cts +1 -1
  10. package/build/legacy/infiniteQueryObserver.d.ts +1 -1
  11. package/build/legacy/mutation.d.cts +1 -1
  12. package/build/legacy/mutation.d.ts +1 -1
  13. package/build/legacy/mutationCache.d.cts +1 -1
  14. package/build/legacy/mutationCache.d.ts +1 -1
  15. package/build/legacy/mutationObserver.d.cts +1 -1
  16. package/build/legacy/mutationObserver.d.ts +1 -1
  17. package/build/legacy/queriesObserver.d.cts +1 -1
  18. package/build/legacy/queriesObserver.d.ts +1 -1
  19. package/build/legacy/query.d.cts +1 -1
  20. package/build/legacy/query.d.ts +1 -1
  21. package/build/legacy/queryCache.d.cts +1 -1
  22. package/build/legacy/queryCache.d.ts +1 -1
  23. package/build/legacy/queryClient.d.cts +1 -1
  24. package/build/legacy/queryClient.d.ts +1 -1
  25. package/build/legacy/queryObserver.cjs +6 -12
  26. package/build/legacy/queryObserver.cjs.map +1 -1
  27. package/build/legacy/queryObserver.d.cts +1 -1
  28. package/build/legacy/queryObserver.d.ts +1 -1
  29. package/build/legacy/queryObserver.js +6 -12
  30. package/build/legacy/queryObserver.js.map +1 -1
  31. package/build/legacy/retryer.d.cts +1 -1
  32. package/build/legacy/retryer.d.ts +1 -1
  33. package/build/legacy/streamedQuery.cjs +23 -17
  34. package/build/legacy/streamedQuery.cjs.map +1 -1
  35. package/build/legacy/streamedQuery.d.cts +6 -3
  36. package/build/legacy/streamedQuery.d.ts +6 -3
  37. package/build/legacy/streamedQuery.js +23 -17
  38. package/build/legacy/streamedQuery.js.map +1 -1
  39. package/build/legacy/types.cjs.map +1 -1
  40. package/build/legacy/types.d.cts +1 -1
  41. package/build/legacy/types.d.ts +1 -1
  42. package/build/legacy/types.js.map +1 -1
  43. package/build/legacy/utils.d.cts +1 -1
  44. package/build/legacy/utils.d.ts +1 -1
  45. package/build/modern/{hydration-BlEK5ylC.d.ts → hydration-C0rn_HEc.d.ts} +1 -2
  46. package/build/modern/{hydration-CwYEwyQI.d.cts → hydration-DgVqMV9G.d.cts} +1 -2
  47. package/build/modern/hydration.d.cts +1 -1
  48. package/build/modern/hydration.d.ts +1 -1
  49. package/build/modern/index.d.cts +1 -1
  50. package/build/modern/index.d.ts +1 -1
  51. package/build/modern/infiniteQueryBehavior.d.cts +1 -1
  52. package/build/modern/infiniteQueryBehavior.d.ts +1 -1
  53. package/build/modern/infiniteQueryObserver.d.cts +1 -1
  54. package/build/modern/infiniteQueryObserver.d.ts +1 -1
  55. package/build/modern/mutation.d.cts +1 -1
  56. package/build/modern/mutation.d.ts +1 -1
  57. package/build/modern/mutationCache.d.cts +1 -1
  58. package/build/modern/mutationCache.d.ts +1 -1
  59. package/build/modern/mutationObserver.d.cts +1 -1
  60. package/build/modern/mutationObserver.d.ts +1 -1
  61. package/build/modern/queriesObserver.d.cts +1 -1
  62. package/build/modern/queriesObserver.d.ts +1 -1
  63. package/build/modern/query.d.cts +1 -1
  64. package/build/modern/query.d.ts +1 -1
  65. package/build/modern/queryCache.d.cts +1 -1
  66. package/build/modern/queryCache.d.ts +1 -1
  67. package/build/modern/queryClient.d.cts +1 -1
  68. package/build/modern/queryClient.d.ts +1 -1
  69. package/build/modern/queryObserver.cjs +6 -12
  70. package/build/modern/queryObserver.cjs.map +1 -1
  71. package/build/modern/queryObserver.d.cts +1 -1
  72. package/build/modern/queryObserver.d.ts +1 -1
  73. package/build/modern/queryObserver.js +6 -12
  74. package/build/modern/queryObserver.js.map +1 -1
  75. package/build/modern/retryer.d.cts +1 -1
  76. package/build/modern/retryer.d.ts +1 -1
  77. package/build/modern/streamedQuery.cjs +23 -17
  78. package/build/modern/streamedQuery.cjs.map +1 -1
  79. package/build/modern/streamedQuery.d.cts +6 -3
  80. package/build/modern/streamedQuery.d.ts +6 -3
  81. package/build/modern/streamedQuery.js +23 -17
  82. package/build/modern/streamedQuery.js.map +1 -1
  83. package/build/modern/types.cjs.map +1 -1
  84. package/build/modern/types.d.cts +1 -1
  85. package/build/modern/types.d.ts +1 -1
  86. package/build/modern/types.js.map +1 -1
  87. package/build/modern/utils.d.cts +1 -1
  88. package/build/modern/utils.d.ts +1 -1
  89. package/package.json +1 -1
  90. package/src/queryObserver.ts +6 -14
  91. package/src/streamedQuery.ts +38 -21
  92. package/src/types.ts +0 -5
@@ -733,7 +733,6 @@ interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TD
733
733
  type WithRequired<TTarget, TKey extends keyof TTarget> = TTarget & {
734
734
  [_ in TKey]: {};
735
735
  };
736
- type Optional<TTarget, TKey extends keyof TTarget> = Pick<Partial<TTarget>, TKey> & OmitKeyof<TTarget, TKey>;
737
736
  type DefaultedQueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = WithRequired<QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>;
738
737
  interface InfiniteQueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserverOptions<TQueryFnData, TError, TData, InfiniteData<TQueryData, TPageParam>, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions<TQueryFnData, TPageParam> {
739
738
  }
@@ -1356,4 +1355,4 @@ declare function defaultShouldDehydrateQuery(query: Query): boolean;
1356
1355
  declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState;
1357
1356
  declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void;
1358
1357
 
1359
- 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, 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 };
1358
+ 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 DefaultOptions 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 DefinedQueryObserverResult as aA, type QueryObserverResult as aB, type InfiniteQueryObserverBaseResult as aC, type InfiniteQueryObserverPendingResult as aD, type InfiniteQueryObserverLoadingResult as aE, type InfiniteQueryObserverLoadingErrorResult as aF, type InfiniteQueryObserverRefetchErrorResult as aG, type InfiniteQueryObserverSuccessResult as aH, type InfiniteQueryObserverPlaceholderResult as aI, type DefinedInfiniteQueryObserverResult as aJ, type InfiniteQueryObserverResult as aK, type MutationKey as aL, type MutationStatus as aM, type MutationScope as aN, type MutationMeta as aO, type MutationFunction as aP, type MutationOptions as aQ, type MutationObserverOptions as aR, type MutateOptions as aS, type MutateFunction as aT, type MutationObserverBaseResult as aU, type MutationObserverIdleResult as aV, type MutationObserverLoadingResult as aW, type MutationObserverErrorResult as aX, type MutationObserverSuccessResult as aY, type MutationObserverResult as aZ, type QueryClientConfig as a_, type QueryObserverOptions as aa, type WithRequired as ab, type DefaultedQueryObserverOptions as ac, type InfiniteQueryObserverOptions as ad, type DefaultedInfiniteQueryObserverOptions as ae, type FetchQueryOptions as af, type EnsureQueryDataOptions as ag, type EnsureInfiniteQueryDataOptions as ah, type FetchInfiniteQueryOptions as ai, type ResultOptions as aj, type RefetchOptions as ak, type InvalidateQueryFilters as al, type RefetchQueryFilters as am, type InvalidateOptions as an, type ResetOptions as ao, type FetchNextPageOptions as ap, type FetchPreviousPageOptions as aq, type QueryStatus as ar, type FetchStatus as as, type QueryObserverBaseResult as at, type QueryObserverPendingResult as au, type QueryObserverLoadingResult as av, type QueryObserverLoadingErrorResult as aw, type QueryObserverRefetchErrorResult as ax, type QueryObserverSuccessResult as ay, type QueryObserverPlaceholderResult as az, QueryClient as b, type CancelOptions as b0, type SetDataOptions as b1, type NotifyEventType as b2, type NotifyEvent as b3, type QueryBehavior as b4, type FetchContext as b5, type FetchDirection as b6, type FetchMeta as b7, type FetchOptions as b8, type Action$1 as b9, createRetryer as bA, type SetStateOptions as ba, fetchState as bb, type Action as bc, getDefaultState as bd, type QueryTypeFilter as be, noop as bf, functionalUpdate as bg, isValidTimeout as bh, timeUntilStale as bi, resolveStaleTime as bj, resolveEnabled as bk, hashQueryKeyByOptions as bl, partialMatchKey as bm, shallowEqualObjects as bn, isPlainArray as bo, isPlainObject as bp, sleep as bq, replaceData as br, addToEnd as bs, addToStart as bt, ensureQueryFn as bu, type QueryStore as bv, type Retryer as bw, type RetryValue as bx, type RetryDelayValue as by, canFetch 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 };
@@ -733,7 +733,6 @@ interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TD
733
733
  type WithRequired<TTarget, TKey extends keyof TTarget> = TTarget & {
734
734
  [_ in TKey]: {};
735
735
  };
736
- type Optional<TTarget, TKey extends keyof TTarget> = Pick<Partial<TTarget>, TKey> & OmitKeyof<TTarget, TKey>;
737
736
  type DefaultedQueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = WithRequired<QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>;
738
737
  interface InfiniteQueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserverOptions<TQueryFnData, TError, TData, InfiniteData<TQueryData, TPageParam>, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions<TQueryFnData, TPageParam> {
739
738
  }
@@ -1356,4 +1355,4 @@ declare function defaultShouldDehydrateQuery(query: Query): boolean;
1356
1355
  declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState;
1357
1356
  declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void;
1358
1357
 
1359
- 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, 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 };
1358
+ 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 DefaultOptions 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 DefinedQueryObserverResult as aA, type QueryObserverResult as aB, type InfiniteQueryObserverBaseResult as aC, type InfiniteQueryObserverPendingResult as aD, type InfiniteQueryObserverLoadingResult as aE, type InfiniteQueryObserverLoadingErrorResult as aF, type InfiniteQueryObserverRefetchErrorResult as aG, type InfiniteQueryObserverSuccessResult as aH, type InfiniteQueryObserverPlaceholderResult as aI, type DefinedInfiniteQueryObserverResult as aJ, type InfiniteQueryObserverResult as aK, type MutationKey as aL, type MutationStatus as aM, type MutationScope as aN, type MutationMeta as aO, type MutationFunction as aP, type MutationOptions as aQ, type MutationObserverOptions as aR, type MutateOptions as aS, type MutateFunction as aT, type MutationObserverBaseResult as aU, type MutationObserverIdleResult as aV, type MutationObserverLoadingResult as aW, type MutationObserverErrorResult as aX, type MutationObserverSuccessResult as aY, type MutationObserverResult as aZ, type QueryClientConfig as a_, type QueryObserverOptions as aa, type WithRequired as ab, type DefaultedQueryObserverOptions as ac, type InfiniteQueryObserverOptions as ad, type DefaultedInfiniteQueryObserverOptions as ae, type FetchQueryOptions as af, type EnsureQueryDataOptions as ag, type EnsureInfiniteQueryDataOptions as ah, type FetchInfiniteQueryOptions as ai, type ResultOptions as aj, type RefetchOptions as ak, type InvalidateQueryFilters as al, type RefetchQueryFilters as am, type InvalidateOptions as an, type ResetOptions as ao, type FetchNextPageOptions as ap, type FetchPreviousPageOptions as aq, type QueryStatus as ar, type FetchStatus as as, type QueryObserverBaseResult as at, type QueryObserverPendingResult as au, type QueryObserverLoadingResult as av, type QueryObserverLoadingErrorResult as aw, type QueryObserverRefetchErrorResult as ax, type QueryObserverSuccessResult as ay, type QueryObserverPlaceholderResult as az, QueryClient as b, type CancelOptions as b0, type SetDataOptions as b1, type NotifyEventType as b2, type NotifyEvent as b3, type QueryBehavior as b4, type FetchContext as b5, type FetchDirection as b6, type FetchMeta as b7, type FetchOptions as b8, type Action$1 as b9, createRetryer as bA, type SetStateOptions as ba, fetchState as bb, type Action as bc, getDefaultState as bd, type QueryTypeFilter as be, noop as bf, functionalUpdate as bg, isValidTimeout as bh, timeUntilStale as bi, resolveStaleTime as bj, resolveEnabled as bk, hashQueryKeyByOptions as bl, partialMatchKey as bm, shallowEqualObjects as bn, isPlainArray as bo, isPlainObject as bp, sleep as bq, replaceData as br, addToEnd as bs, addToStart as bt, ensureQueryFn as bu, type QueryStore as bv, type Retryer as bw, type RetryValue as bx, type RetryDelayValue as by, canFetch 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, n as dehydrate, o as hydrate } from './hydration-CwYEwyQI.cjs';
1
+ export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, o as hydrate } from './hydration-DgVqMV9G.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, n as dehydrate, o as hydrate } from './hydration-BlEK5ylC.js';
1
+ export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, o as hydrate } from './hydration-C0rn_HEc.js';
2
2
  import './removable.js';
3
3
  import './subscribable.js';
@@ -1,4 +1,4 @@
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-CwYEwyQI.cjs';
1
+ export { I as AnyDataTag, b0 as CancelOptions, C as CancelledError, J as DataTag, z as DefaultError, a$ as DefaultOptions, ae as DefaultedInfiniteQueryObserverOptions, ac as DefaultedQueryObserverOptions, aJ as DefinedInfiniteQueryObserverResult, aA as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, V as Enabled, ah as EnsureInfiniteQueryDataOptions, ag as EnsureQueryDataOptions, ai as FetchInfiniteQueryOptions, ap as FetchNextPageOptions, aq as FetchPreviousPageOptions, af as FetchQueryOptions, as as FetchStatus, a1 as GetNextPageParamFunction, a0 as GetPreviousPageParamFunction, H as HydrateOptions, K as InferDataFromTag, L as InferErrorFromTag, a2 as InfiniteData, aC as InfiniteQueryObserverBaseResult, aF as InfiniteQueryObserverLoadingErrorResult, aE as InfiniteQueryObserverLoadingResult, ad as InfiniteQueryObserverOptions, aD as InfiniteQueryObserverPendingResult, aI as InfiniteQueryObserverPlaceholderResult, aG as InfiniteQueryObserverRefetchErrorResult, aK as InfiniteQueryObserverResult, aH as InfiniteQueryObserverSuccessResult, a8 as InfiniteQueryPageParamsOptions, Y as InitialDataFunction, a7 as InitialPageParam, an as InvalidateOptions, al as InvalidateQueryFilters, aT as MutateFunction, aS as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aP as MutationFunction, aL as MutationKey, aO as MutationMeta, e as MutationObserver, aU as MutationObserverBaseResult, aX as MutationObserverErrorResult, aV as MutationObserverIdleResult, aW as MutationObserverLoadingResult, aR as MutationObserverOptions, aZ as MutationObserverResult, aY as MutationObserverSuccessResult, aQ as MutationOptions, aN as MutationScope, v as MutationState, aM as MutationStatus, a4 as NetworkMode, N as NoInfer, b3 as NotifyEvent, b2 as NotifyEventType, a5 as NotifyOnChangeProps, O as OmitKeyof, 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, at as QueryObserverBaseResult, aw as QueryObserverLoadingErrorResult, av as QueryObserverLoadingResult, aa as QueryObserverOptions, au as QueryObserverPendingResult, az as QueryObserverPlaceholderResult, ax as QueryObserverRefetchErrorResult, aB as QueryObserverResult, ay as QueryObserverSuccessResult, a6 as QueryOptions, W as QueryPersister, t as QueryState, ar as QueryStatus, ak as RefetchOptions, am as RefetchQueryFilters, R as Register, ao as ResetOptions, aj as ResultOptions, b1 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-DgVqMV9G.cjs';
2
2
  export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs';
3
3
  export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs';
4
4
  export { defaultScheduler, notifyManager } from './notifyManager.cjs';
@@ -1,4 +1,4 @@
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-BlEK5ylC.js';
1
+ export { I as AnyDataTag, b0 as CancelOptions, C as CancelledError, J as DataTag, z as DefaultError, a$ as DefaultOptions, ae as DefaultedInfiniteQueryObserverOptions, ac as DefaultedQueryObserverOptions, aJ as DefinedInfiniteQueryObserverResult, aA as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, V as Enabled, ah as EnsureInfiniteQueryDataOptions, ag as EnsureQueryDataOptions, ai as FetchInfiniteQueryOptions, ap as FetchNextPageOptions, aq as FetchPreviousPageOptions, af as FetchQueryOptions, as as FetchStatus, a1 as GetNextPageParamFunction, a0 as GetPreviousPageParamFunction, H as HydrateOptions, K as InferDataFromTag, L as InferErrorFromTag, a2 as InfiniteData, aC as InfiniteQueryObserverBaseResult, aF as InfiniteQueryObserverLoadingErrorResult, aE as InfiniteQueryObserverLoadingResult, ad as InfiniteQueryObserverOptions, aD as InfiniteQueryObserverPendingResult, aI as InfiniteQueryObserverPlaceholderResult, aG as InfiniteQueryObserverRefetchErrorResult, aK as InfiniteQueryObserverResult, aH as InfiniteQueryObserverSuccessResult, a8 as InfiniteQueryPageParamsOptions, Y as InitialDataFunction, a7 as InitialPageParam, an as InvalidateOptions, al as InvalidateQueryFilters, aT as MutateFunction, aS as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aP as MutationFunction, aL as MutationKey, aO as MutationMeta, e as MutationObserver, aU as MutationObserverBaseResult, aX as MutationObserverErrorResult, aV as MutationObserverIdleResult, aW as MutationObserverLoadingResult, aR as MutationObserverOptions, aZ as MutationObserverResult, aY as MutationObserverSuccessResult, aQ as MutationOptions, aN as MutationScope, v as MutationState, aM as MutationStatus, a4 as NetworkMode, N as NoInfer, b3 as NotifyEvent, b2 as NotifyEventType, a5 as NotifyOnChangeProps, O as OmitKeyof, 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, at as QueryObserverBaseResult, aw as QueryObserverLoadingErrorResult, av as QueryObserverLoadingResult, aa as QueryObserverOptions, au as QueryObserverPendingResult, az as QueryObserverPlaceholderResult, ax as QueryObserverRefetchErrorResult, aB as QueryObserverResult, ay as QueryObserverSuccessResult, a6 as QueryOptions, W as QueryPersister, t as QueryState, ar as QueryStatus, ak as RefetchOptions, am as RefetchQueryFilters, R as Register, ao as ResetOptions, aj as ResultOptions, b1 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-C0rn_HEc.js';
2
2
  export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js';
3
3
  export { InfiniteQueryObserver } from './infiniteQueryObserver.js';
4
4
  export { defaultScheduler, notifyManager } from './notifyManager.js';
@@ -1,4 +1,4 @@
1
- import { b5 as QueryBehavior, a2 as InfiniteData, a8 as InfiniteQueryPageParamsOptions } from './hydration-CwYEwyQI.cjs';
1
+ import { b4 as QueryBehavior, a2 as InfiniteData, a8 as InfiniteQueryPageParamsOptions } from './hydration-DgVqMV9G.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-BlEK5ylC.js';
1
+ import { b4 as QueryBehavior, a2 as InfiniteData, a8 as InfiniteQueryPageParamsOptions } from './hydration-C0rn_HEc.js';
2
2
  import './removable.js';
3
3
  import './subscribable.js';
4
4
 
@@ -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, af as DefaultedInfiniteQueryObserverOptions, aq as FetchNextPageOptions, ar as FetchPreviousPageOptions, u as Query } from './hydration-CwYEwyQI.cjs';
1
+ import { z as DefaultError, a2 as InfiniteData, A as QueryKey, c as QueryObserver, aK as InfiniteQueryObserverResult, b as QueryClient, ad as InfiniteQueryObserverOptions, ae as DefaultedInfiniteQueryObserverOptions, ap as FetchNextPageOptions, aq as FetchPreviousPageOptions, u as Query } from './hydration-DgVqMV9G.cjs';
2
2
  import { Subscribable } from './subscribable.cjs';
3
3
  import './removable.cjs';
4
4
 
@@ -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, af as DefaultedInfiniteQueryObserverOptions, aq as FetchNextPageOptions, ar as FetchPreviousPageOptions, u as Query } from './hydration-BlEK5ylC.js';
1
+ import { z as DefaultError, a2 as InfiniteData, A as QueryKey, c as QueryObserver, aK as InfiniteQueryObserverResult, b as QueryClient, ad as InfiniteQueryObserverOptions, ae as DefaultedInfiniteQueryObserverOptions, ap as FetchNextPageOptions, aq as FetchPreviousPageOptions, u as Query } from './hydration-C0rn_HEc.js';
2
2
  import { Subscribable } from './subscribable.js';
3
3
  import './removable.js';
4
4
 
@@ -1,3 +1,3 @@
1
1
  import './removable.cjs';
2
- export { bd as Action, w as Mutation, v as MutationState, be as getDefaultState } from './hydration-CwYEwyQI.cjs';
2
+ export { bc as Action, w as Mutation, v as MutationState, bd as getDefaultState } from './hydration-DgVqMV9G.cjs';
3
3
  import './subscribable.cjs';
@@ -1,3 +1,3 @@
1
1
  import './removable.js';
2
- export { bd as Action, w as Mutation, v as MutationState, be as getDefaultState } from './hydration-BlEK5ylC.js';
2
+ export { bc as Action, w as Mutation, v as MutationState, bd as getDefaultState } from './hydration-C0rn_HEc.js';
3
3
  import './subscribable.js';
@@ -1,3 +1,3 @@
1
- export { M as MutationCache, d as MutationCacheNotifyEvent } from './hydration-CwYEwyQI.cjs';
1
+ export { M as MutationCache, d as MutationCacheNotifyEvent } from './hydration-DgVqMV9G.cjs';
2
2
  import './subscribable.cjs';
3
3
  import './removable.cjs';
@@ -1,3 +1,3 @@
1
- export { M as MutationCache, d as MutationCacheNotifyEvent } from './hydration-BlEK5ylC.js';
1
+ export { M as MutationCache, d as MutationCacheNotifyEvent } from './hydration-C0rn_HEc.js';
2
2
  import './subscribable.js';
3
3
  import './removable.js';
@@ -1,3 +1,3 @@
1
1
  import './subscribable.cjs';
2
- export { e as MutationObserver } from './hydration-CwYEwyQI.cjs';
2
+ export { e as MutationObserver } from './hydration-DgVqMV9G.cjs';
3
3
  import './removable.cjs';
@@ -1,3 +1,3 @@
1
1
  import './subscribable.js';
2
- export { e as MutationObserver } from './hydration-BlEK5ylC.js';
2
+ export { e as MutationObserver } from './hydration-C0rn_HEc.js';
3
3
  import './removable.js';
@@ -1,4 +1,4 @@
1
- import { aC as QueryObserverResult, b as QueryClient, aa as QueryObserverOptions, u as Query, c as QueryObserver } from './hydration-CwYEwyQI.cjs';
1
+ import { aB as QueryObserverResult, b as QueryClient, aa as QueryObserverOptions, u as Query, c as QueryObserver } from './hydration-DgVqMV9G.cjs';
2
2
  import { Subscribable } from './subscribable.cjs';
3
3
  import './removable.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { aC as QueryObserverResult, b as QueryClient, aa as QueryObserverOptions, u as Query, c as QueryObserver } from './hydration-BlEK5ylC.js';
1
+ import { aB as QueryObserverResult, b as QueryClient, aa as QueryObserverOptions, u as Query, c as QueryObserver } from './hydration-C0rn_HEc.js';
2
2
  import { Subscribable } from './subscribable.js';
3
3
  import './removable.js';
4
4
 
@@ -1,3 +1,3 @@
1
1
  import './removable.cjs';
2
- export { ba as Action, b6 as FetchContext, b7 as FetchDirection, b8 as FetchMeta, b9 as FetchOptions, u as Query, b5 as QueryBehavior, t as QueryState, bb as SetStateOptions, bc as fetchState } from './hydration-CwYEwyQI.cjs';
2
+ export { b9 as Action, b5 as FetchContext, b6 as FetchDirection, b7 as FetchMeta, b8 as FetchOptions, u as Query, b4 as QueryBehavior, t as QueryState, ba as SetStateOptions, bb as fetchState } from './hydration-DgVqMV9G.cjs';
3
3
  import './subscribable.cjs';
@@ -1,3 +1,3 @@
1
1
  import './removable.js';
2
- export { ba as Action, b6 as FetchContext, b7 as FetchDirection, b8 as FetchMeta, b9 as FetchOptions, u as Query, b5 as QueryBehavior, t as QueryState, bb as SetStateOptions, bc as fetchState } from './hydration-BlEK5ylC.js';
2
+ export { b9 as Action, b5 as FetchContext, b6 as FetchDirection, b7 as FetchMeta, b8 as FetchOptions, u as Query, b4 as QueryBehavior, t as QueryState, ba as SetStateOptions, bb as fetchState } from './hydration-C0rn_HEc.js';
3
3
  import './subscribable.js';
@@ -1,3 +1,3 @@
1
- export { Q as QueryCache, a as QueryCacheNotifyEvent, bw as QueryStore } from './hydration-CwYEwyQI.cjs';
1
+ export { Q as QueryCache, a as QueryCacheNotifyEvent, bv as QueryStore } from './hydration-DgVqMV9G.cjs';
2
2
  import './subscribable.cjs';
3
3
  import './removable.cjs';
@@ -1,3 +1,3 @@
1
- export { Q as QueryCache, a as QueryCacheNotifyEvent, bw as QueryStore } from './hydration-BlEK5ylC.js';
1
+ export { Q as QueryCache, a as QueryCacheNotifyEvent, bv as QueryStore } from './hydration-C0rn_HEc.js';
2
2
  import './subscribable.js';
3
3
  import './removable.js';
@@ -1,3 +1,3 @@
1
- export { b as QueryClient } from './hydration-CwYEwyQI.cjs';
1
+ export { b as QueryClient } from './hydration-DgVqMV9G.cjs';
2
2
  import './removable.cjs';
3
3
  import './subscribable.cjs';
@@ -1,3 +1,3 @@
1
- export { b as QueryClient } from './hydration-BlEK5ylC.js';
1
+ export { b as QueryClient } from './hydration-C0rn_HEc.js';
2
2
  import './removable.js';
3
3
  import './subscribable.js';
@@ -160,19 +160,13 @@ var QueryObserver = class extends import_subscribable.Subscribable {
160
160
  return __privateGet(this, _currentResult);
161
161
  }
162
162
  trackResult(result, onPropTracked) {
163
- const trackedResult = {};
164
- Object.keys(result).forEach((key) => {
165
- Object.defineProperty(trackedResult, key, {
166
- configurable: false,
167
- enumerable: true,
168
- get: () => {
169
- this.trackProp(key);
170
- onPropTracked == null ? void 0 : onPropTracked(key);
171
- return result[key];
172
- }
173
- });
163
+ return new Proxy(result, {
164
+ get: (target, key) => {
165
+ this.trackProp(key);
166
+ onPropTracked == null ? void 0 : onPropTracked(key);
167
+ return Reflect.get(target, key);
168
+ }
174
169
  });
175
- return trackedResult;
176
170
  }
177
171
  trackProp(key) {
178
172
  __privateGet(this, _trackedProps).add(key);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n QueryOptions,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener<TData, TError> = (\n result: QueryObserverResult<TData, TError>,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable<QueryObserverListener<TData, TError>> {\n #client: QueryClient\n #currentQuery: Query<TQueryFnData, TError, TQueryData, TQueryKey> = undefined!\n #currentQueryInitialState: QueryState<TQueryData, TError> = undefined!\n #currentResult: QueryObserverResult<TData, TError> = undefined!\n #currentResultState?: QueryState<TQueryData, TError>\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable<TData>\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query<TQueryFnData, TError, TQueryData, TQueryKey>\n #staleTimeoutId?: ReturnType<typeof setTimeout>\n #refetchIntervalId?: ReturnType<typeof setInterval>\n #currentRefetchInterval?: number | false\n #trackedProps = new Set<keyof QueryObserverResult>()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n if (!this.options.experimental_prefetchInRender) {\n this.#currentThenable.reject(\n new Error('experimental_prefetchInRender feature flag is not enabled'),\n )\n }\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult<TData, TError> {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult<TData, TError> {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult<TData, TError>,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult<TData, TError> {\n const trackedResult = {} as QueryObserverResult<TData, TError>\n\n Object.keys(result).forEach((key) => {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: () => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n return result[key as keyof QueryObserverResult]\n },\n })\n })\n\n return trackedResult\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query<TQueryFnData, TError, TQueryData, TQueryKey> {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult<TData, TError>\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise<QueryObserverResult<TData, TError>> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise<QueryObserverResult<TData, TError>> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit<ObserverFetchOptions, 'initialPromise'>,\n ): Promise<TQueryData | undefined> {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise<TQueryData | undefined> = this.#currentQuery.fetch(\n this.options as QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey>,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult<TData, TError> {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult<TData, TError>\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction<TQueryData>\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError as any\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult<TData, TError> = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n }\n\n const nextResult = result as QueryObserverResult<TData, TError>\n\n if (this.options.experimental_prefetchInRender) {\n const finalizeThenableIfPossible = (thenable: PendingThenable<TData>) => {\n if (nextResult.status === 'error') {\n thenable.reject(nextResult.error)\n } else if (nextResult.data !== undefined) {\n thenable.resolve(nextResult.data)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (\n nextResult.status === 'error' ||\n nextResult.data !== prevThenable.value\n ) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (\n nextResult.status !== 'error' ||\n nextResult.error !== prevThenable.reason\n ) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult<TData, TError>\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query<TQueryFnData, TError, TQueryData, TQueryKey>\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query<any, any, any, any>,\n options: QueryObserverOptions<any, any, any, any>,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query<any, any, any, any>,\n options: QueryObserverOptions<any, any, any, any, any>,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query<any, any, any, any>,\n options: QueryObserverOptions<any, any, any, any, any>,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (resolveEnabled(options.enabled, query) !== false) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query<any, any, any, any>,\n prevQuery: Query<any, any, any, any>,\n options: QueryObserverOptions<any, any, any, any, any>,\n prevOptions: QueryObserverOptions<any, any, any, any, any>,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query<any, any, any, any>,\n options: QueryObserverOptions<any, any, any, any, any>,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n optimisticResult: QueryObserverResult<TData, TError>,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,2BAA8B;AAC9B,mBAA2B;AAC3B,0BAA6B;AAC7B,sBAAgC;AAChC,mBASO;AAdP;AAsCO,IAAM,gBAAN,cAMG,iCAAmD;AAAA,EAyB3D,YACE,QACO,SAOP;AACA,UAAM;AARC;AAjCJ;AAOL;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAGA;AAAA;AAAA;AACA;AACA;AACA;AACA,sCAAgB,oBAAI,IAA+B;AAcjD,uBAAK,SAAU;AACf,uBAAK,cAAe;AACpB,uBAAK,sBAAmB,iCAAgB;AACxC,QAAI,CAAC,KAAK,QAAQ,+BAA+B;AAC/C,yBAAK,kBAAiB;AAAA,QACpB,IAAI,MAAM,2DAA2D;AAAA,MACvE;AAAA,IACF;AAEA,SAAK,YAAY;AACjB,SAAK,WAAW,OAAO;AAAA,EACzB;AAAA,EAEU,cAAoB;AAC5B,SAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AAAA,EACvC;AAAA,EAEU,cAAoB;AAC5B,QAAI,KAAK,UAAU,SAAS,GAAG;AAC7B,yBAAK,eAAc,YAAY,IAAI;A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;AAEA,SAAS,mBACP,OACA,SACS;AACT,SACE,kBAAkB,OAAO,OAAO,KAC/B,MAAM,MAAM,SAAS,UACpB,cAAc,OAAO,SAAS,QAAQ,cAAc;AAE1D;AAEA,SAAS,cACP,OACA,SACA,OAGA;AACA,UAAI,6BAAe,QAAQ,SAAS,KAAK,MAAM,OAAO;AACpD,UAAM,QAAQ,OAAO,UAAU,aAAa,MAAM,KAAK,IAAI;AAE3D,WAAO,UAAU,YAAa,UAAU,SAAS,QAAQ,OAAO,OAAO;AAAA,EACzE;AACA,SAAO;AACT;AAEA,SAAS,sBACP,OACA,WACA,SACA,aACS;AACT,UACG,UAAU,iBACT,6BAAe,YAAY,SAAS,KAAK,MAAM,WAChD,CAAC,QAAQ,YAAY,MAAM,MAAM,WAAW,YAC7C,QAAQ,OAAO,OAAO;AAE1B;AAEA,SAAS,QACP,OACA,SACS;AACT,aACE,6BAAe,QAAQ,SAAS,KAAK,MAAM,SAC3C,MAAM,kBAAc,+BAAiB,QAAQ,WAAW,KAAK,CAAC;AAElE;AAIA,SAAS,sCAOP,UACA,kBACA;AAGA,MAAI,KAAC,kCAAoB,SAAS,iBAAiB,GAAG,gBAAgB,GAAG;AACvE,WAAO;AAAA,EACT;AAGA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n QueryOptions,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener<TData, TError> = (\n result: QueryObserverResult<TData, TError>,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable<QueryObserverListener<TData, TError>> {\n #client: QueryClient\n #currentQuery: Query<TQueryFnData, TError, TQueryData, TQueryKey> = undefined!\n #currentQueryInitialState: QueryState<TQueryData, TError> = undefined!\n #currentResult: QueryObserverResult<TData, TError> = undefined!\n #currentResultState?: QueryState<TQueryData, TError>\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable<TData>\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query<TQueryFnData, TError, TQueryData, TQueryKey>\n #staleTimeoutId?: ReturnType<typeof setTimeout>\n #refetchIntervalId?: ReturnType<typeof setInterval>\n #currentRefetchInterval?: number | false\n #trackedProps = new Set<keyof QueryObserverResult>()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n if (!this.options.experimental_prefetchInRender) {\n this.#currentThenable.reject(\n new Error('experimental_prefetchInRender feature flag is not enabled'),\n )\n }\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult<TData, TError> {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult<TData, TError> {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult<TData, TError>,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult<TData, TError> {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n return Reflect.get(target, key)\n },\n })\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query<TQueryFnData, TError, TQueryData, TQueryKey> {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult<TData, TError>\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise<QueryObserverResult<TData, TError>> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise<QueryObserverResult<TData, TError>> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit<ObserverFetchOptions, 'initialPromise'>,\n ): Promise<TQueryData | undefined> {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise<TQueryData | undefined> = this.#currentQuery.fetch(\n this.options as QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey>,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult<TData, TError> {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult<TData, TError>\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction<TQueryData>\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError as any\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult<TData, TError> = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n }\n\n const nextResult = result as QueryObserverResult<TData, TError>\n\n if (this.options.experimental_prefetchInRender) {\n const finalizeThenableIfPossible = (thenable: PendingThenable<TData>) => {\n if (nextResult.status === 'error') {\n thenable.reject(nextResult.error)\n } else if (nextResult.data !== undefined) {\n thenable.resolve(nextResult.data)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (\n nextResult.status === 'error' ||\n nextResult.data !== prevThenable.value\n ) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (\n nextResult.status !== 'error' ||\n nextResult.error !== prevThenable.reason\n ) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult<TData, TError>\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query<TQueryFnData, TError, TQueryData, TQueryKey>\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query<any, any, any, any>,\n options: QueryObserverOptions<any, any, any, any>,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query<any, any, any, any>,\n options: QueryObserverOptions<any, any, any, any, any>,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query<any, any, any, any>,\n options: QueryObserverOptions<any, any, any, any, any>,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (resolveEnabled(options.enabled, query) !== false) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query<any, any, any, any>,\n prevQuery: Query<any, any, any, any>,\n options: QueryObserverOptions<any, any, any, any, any>,\n prevOptions: QueryObserverOptions<any, any, any, any, any>,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query<any, any, any, any>,\n options: QueryObserverOptions<any, any, any, any, any>,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n optimisticResult: QueryObserverResult<TData, TError>,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAIA,SAAS,sCAOP,UACA,kBACA;AAGA,MAAI,KAAC,kCAAoB,SAAS,iBAAiB,GAAG,gBAAgB,GAAG;AACvE,WAAO;AAAA,EACT;AAGA,SAAO;AACT;","names":[]}
@@ -1,3 +1,3 @@
1
1
  import './subscribable.cjs';
2
- export { c as QueryObserver } from './hydration-CwYEwyQI.cjs';
2
+ export { c as QueryObserver } from './hydration-DgVqMV9G.cjs';
3
3
  import './removable.cjs';
@@ -1,3 +1,3 @@
1
1
  import './subscribable.js';
2
- export { c as QueryObserver } from './hydration-BlEK5ylC.js';
2
+ export { c as QueryObserver } from './hydration-C0rn_HEc.js';
3
3
  import './removable.js';
@@ -144,19 +144,13 @@ var QueryObserver = class extends Subscribable {
144
144
  return __privateGet(this, _currentResult);
145
145
  }
146
146
  trackResult(result, onPropTracked) {
147
- const trackedResult = {};
148
- Object.keys(result).forEach((key) => {
149
- Object.defineProperty(trackedResult, key, {
150
- configurable: false,
151
- enumerable: true,
152
- get: () => {
153
- this.trackProp(key);
154
- onPropTracked == null ? void 0 : onPropTracked(key);
155
- return result[key];
156
- }
157
- });
147
+ return new Proxy(result, {
148
+ get: (target, key) => {
149
+ this.trackProp(key);
150
+ onPropTracked == null ? void 0 : onPropTracked(key);
151
+ return Reflect.get(target, key);
152
+ }
158
153
  });
159
- return trackedResult;
160
154
  }
161
155
  trackProp(key) {
162
156
  __privateGet(this, _trackedProps).add(key);