@tanstack/query-core 5.14.0 → 5.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/hydration.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +1 -1
- package/build/legacy/index.d.ts +1 -1
- package/build/legacy/index.js.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +1 -1
- package/build/legacy/infiniteQueryObserver.d.ts +1 -1
- package/build/legacy/mutation.cjs.map +1 -1
- package/build/legacy/mutation.d.cts +1 -1
- package/build/legacy/mutation.d.ts +1 -1
- package/build/legacy/mutation.js.map +1 -1
- package/build/legacy/mutationCache.cjs.map +1 -1
- package/build/legacy/mutationCache.d.cts +1 -1
- package/build/legacy/mutationCache.d.ts +1 -1
- package/build/legacy/mutationCache.js.map +1 -1
- package/build/legacy/mutationObserver.cjs +7 -21
- package/build/legacy/mutationObserver.cjs.map +1 -1
- package/build/legacy/mutationObserver.d.cts +1 -1
- package/build/legacy/mutationObserver.d.ts +1 -1
- package/build/legacy/mutationObserver.js +7 -21
- package/build/legacy/mutationObserver.js.map +1 -1
- package/build/legacy/queriesObserver.d.cts +1 -1
- package/build/legacy/queriesObserver.d.ts +1 -1
- package/build/legacy/query.d.cts +1 -1
- package/build/legacy/query.d.ts +1 -1
- package/build/legacy/queryCache.d.cts +1 -1
- package/build/legacy/queryCache.d.ts +1 -1
- package/build/legacy/{queryClient-N0XKecPj.d.ts → queryClient-iw7Hbrkm.d.ts} +2 -2
- package/build/legacy/{queryClient-UnTFzrI2.d.ts → queryClient-qZFrH27l.d.ts} +2 -2
- package/build/legacy/queryClient.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryObserver.d.cts +1 -1
- package/build/legacy/queryObserver.d.ts +1 -1
- package/build/legacy/retryer.d.cts +1 -1
- package/build/legacy/retryer.d.ts +1 -1
- package/build/legacy/types.cjs.map +1 -1
- package/build/legacy/types.d.cts +1 -1
- package/build/legacy/types.d.ts +1 -1
- package/build/legacy/utils.d.cts +1 -1
- package/build/legacy/utils.d.ts +1 -1
- package/build/modern/hydration.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +1 -1
- package/build/modern/index.d.ts +1 -1
- package/build/modern/index.js.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +1 -1
- package/build/modern/infiniteQueryObserver.d.ts +1 -1
- package/build/modern/mutation.cjs.map +1 -1
- package/build/modern/mutation.d.cts +1 -1
- package/build/modern/mutation.d.ts +1 -1
- package/build/modern/mutation.js.map +1 -1
- package/build/modern/mutationCache.cjs.map +1 -1
- package/build/modern/mutationCache.d.cts +1 -1
- package/build/modern/mutationCache.d.ts +1 -1
- package/build/modern/mutationCache.js.map +1 -1
- package/build/modern/mutationObserver.cjs +7 -18
- package/build/modern/mutationObserver.cjs.map +1 -1
- package/build/modern/mutationObserver.d.cts +1 -1
- package/build/modern/mutationObserver.d.ts +1 -1
- package/build/modern/mutationObserver.js +7 -18
- package/build/modern/mutationObserver.js.map +1 -1
- package/build/modern/queriesObserver.d.cts +1 -1
- package/build/modern/queriesObserver.d.ts +1 -1
- package/build/modern/query.d.cts +1 -1
- package/build/modern/query.d.ts +1 -1
- package/build/modern/queryCache.d.cts +1 -1
- package/build/modern/queryCache.d.ts +1 -1
- package/build/modern/{queryClient-N0XKecPj.d.ts → queryClient-iw7Hbrkm.d.ts} +2 -2
- package/build/modern/{queryClient-UnTFzrI2.d.ts → queryClient-qZFrH27l.d.ts} +2 -2
- package/build/modern/queryClient.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryObserver.d.cts +1 -1
- package/build/modern/queryObserver.d.ts +1 -1
- package/build/modern/retryer.d.cts +1 -1
- package/build/modern/retryer.d.ts +1 -1
- package/build/modern/types.cjs.map +1 -1
- package/build/modern/types.d.cts +1 -1
- package/build/modern/types.d.ts +1 -1
- package/build/modern/utils.d.cts +1 -1
- package/build/modern/utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/mutation.ts +1 -1
- package/src/mutationCache.ts +1 -1
- package/src/mutationObserver.ts +8 -18
- package/src/types.ts +1 -1
package/build/modern/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { f as MutationFilters, g as QueryFilters, aI as QueryTypeFilter, U as Updater, aW as addToEnd, aX as addToStart, aK as functionalUpdate, h as hashKey, aO as hashQueryKeyByOptions, aR as isPlainArray, aS as isPlainObject, i as isServer, aL as isValidTimeout, k as keepPreviousData, aN as matchMutation, m as matchQuery, aJ as noop, aP as partialMatchKey, aV as replaceData, r as replaceEqualDeep, aU as scheduleMicrotask, aQ as shallowEqualObjects, aT as sleep, aM as timeUntilStale } from './queryClient-qZFrH27l.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { QueryObserver } from './queryObserver'
|
|
|
8
8
|
export { QueriesObserver } from './queriesObserver'
|
|
9
9
|
export { InfiniteQueryObserver } from './infiniteQueryObserver'
|
|
10
10
|
export { MutationCache } from './mutationCache'
|
|
11
|
+
export type { MutationCacheNotifyEvent } from './mutationCache'
|
|
11
12
|
export { MutationObserver } from './mutationObserver'
|
|
12
13
|
export { notifyManager } from './notifyManager'
|
|
13
14
|
export { focusManager } from './focusManager'
|
package/src/mutation.ts
CHANGED
|
@@ -218,7 +218,7 @@ export class Mutation<
|
|
|
218
218
|
this as Mutation<unknown, unknown, unknown, unknown>,
|
|
219
219
|
)
|
|
220
220
|
|
|
221
|
-
await this.options.onSuccess?.(data, variables, this.state.context)
|
|
221
|
+
await this.options.onSuccess?.(data, variables, this.state.context!)
|
|
222
222
|
|
|
223
223
|
// Notify cache callback
|
|
224
224
|
await this.#mutationCache.config.onSettled?.(
|
package/src/mutationCache.ts
CHANGED
|
@@ -69,7 +69,7 @@ interface NotifyEventMutationUpdated extends NotifyEvent {
|
|
|
69
69
|
action: Action<any, any, any, any>
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
type MutationCacheNotifyEvent =
|
|
72
|
+
export type MutationCacheNotifyEvent =
|
|
73
73
|
| NotifyEventMutationAdded
|
|
74
74
|
| NotifyEventMutationRemoved
|
|
75
75
|
| NotifyEventMutationObserverAdded
|
package/src/mutationObserver.ts
CHANGED
|
@@ -144,29 +144,19 @@ export class MutationObserver<
|
|
|
144
144
|
notifyManager.batch(() => {
|
|
145
145
|
// First trigger the mutate callbacks
|
|
146
146
|
if (this.#mutateOptions && this.hasListeners()) {
|
|
147
|
+
const variables = this.#currentResult.variables!
|
|
148
|
+
const context = this.#currentResult.context
|
|
149
|
+
|
|
147
150
|
if (action?.type === 'success') {
|
|
148
|
-
this.#mutateOptions.onSuccess?.(
|
|
149
|
-
|
|
150
|
-
this.#currentResult.variables!,
|
|
151
|
-
this.#currentResult.context!,
|
|
152
|
-
)
|
|
153
|
-
this.#mutateOptions.onSettled?.(
|
|
154
|
-
action.data,
|
|
155
|
-
null,
|
|
156
|
-
this.#currentResult.variables!,
|
|
157
|
-
this.#currentResult.context,
|
|
158
|
-
)
|
|
151
|
+
this.#mutateOptions.onSuccess?.(action.data, variables, context!)
|
|
152
|
+
this.#mutateOptions.onSettled?.(action.data, null, variables, context)
|
|
159
153
|
} else if (action?.type === 'error') {
|
|
160
|
-
this.#mutateOptions.onError?.(
|
|
161
|
-
action.error,
|
|
162
|
-
this.#currentResult.variables!,
|
|
163
|
-
this.#currentResult.context,
|
|
164
|
-
)
|
|
154
|
+
this.#mutateOptions.onError?.(action.error, variables, context)
|
|
165
155
|
this.#mutateOptions.onSettled?.(
|
|
166
156
|
undefined,
|
|
167
157
|
action.error,
|
|
168
|
-
|
|
169
|
-
|
|
158
|
+
variables,
|
|
159
|
+
context,
|
|
170
160
|
)
|
|
171
161
|
}
|
|
172
162
|
}
|
package/src/types.ts
CHANGED