@tanstack/solid-query 5.30.4 → 5.30.6
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/dev.cjs +6 -1
- package/build/dev.js +6 -1
- package/build/index.cjs +6 -1
- package/build/index.js +6 -1
- package/package.json +1 -1
- package/src/createBaseQuery.ts +5 -1
package/build/dev.cjs
CHANGED
|
@@ -78,6 +78,8 @@ function reconcileFn(store$1, result, reconcileOption, queryHash) {
|
|
|
78
78
|
return { ...result, data: newData };
|
|
79
79
|
}
|
|
80
80
|
var hydratableObserverResult = (query, result) => {
|
|
81
|
+
if (!web.isServer)
|
|
82
|
+
return result;
|
|
81
83
|
const obj = {
|
|
82
84
|
...store.unwrap(result),
|
|
83
85
|
// During SSR, functions cannot be serialized, so we need to remove them
|
|
@@ -194,7 +196,9 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
194
196
|
}
|
|
195
197
|
if (!observerResult.isLoading) {
|
|
196
198
|
resolver = null;
|
|
197
|
-
return resolve(
|
|
199
|
+
return resolve(
|
|
200
|
+
hydratableObserverResult(obs.getCurrentQuery(), observerResult)
|
|
201
|
+
);
|
|
198
202
|
}
|
|
199
203
|
setStateWithReconciliation(observerResult);
|
|
200
204
|
});
|
|
@@ -278,6 +282,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
278
282
|
([obs, opts]) => {
|
|
279
283
|
obs.setOptions(opts);
|
|
280
284
|
setStateWithReconciliation(obs.getOptimisticResult(opts));
|
|
285
|
+
refetch();
|
|
281
286
|
},
|
|
282
287
|
{ defer: true }
|
|
283
288
|
)
|
package/build/dev.js
CHANGED
|
@@ -77,6 +77,8 @@ function reconcileFn(store, result, reconcileOption, queryHash) {
|
|
|
77
77
|
return { ...result, data: newData };
|
|
78
78
|
}
|
|
79
79
|
var hydratableObserverResult = (query, result) => {
|
|
80
|
+
if (!isServer)
|
|
81
|
+
return result;
|
|
80
82
|
const obj = {
|
|
81
83
|
...unwrap(result),
|
|
82
84
|
// During SSR, functions cannot be serialized, so we need to remove them
|
|
@@ -193,7 +195,9 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
193
195
|
}
|
|
194
196
|
if (!observerResult.isLoading) {
|
|
195
197
|
resolver = null;
|
|
196
|
-
return resolve(
|
|
198
|
+
return resolve(
|
|
199
|
+
hydratableObserverResult(obs.getCurrentQuery(), observerResult)
|
|
200
|
+
);
|
|
197
201
|
}
|
|
198
202
|
setStateWithReconciliation(observerResult);
|
|
199
203
|
});
|
|
@@ -277,6 +281,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
277
281
|
([obs, opts]) => {
|
|
278
282
|
obs.setOptions(opts);
|
|
279
283
|
setStateWithReconciliation(obs.getOptimisticResult(opts));
|
|
284
|
+
refetch();
|
|
280
285
|
},
|
|
281
286
|
{ defer: true }
|
|
282
287
|
)
|
package/build/index.cjs
CHANGED
|
@@ -69,6 +69,8 @@ function reconcileFn(store$1, result, reconcileOption, queryHash) {
|
|
|
69
69
|
return { ...result, data: newData };
|
|
70
70
|
}
|
|
71
71
|
var hydratableObserverResult = (query, result) => {
|
|
72
|
+
if (!web.isServer)
|
|
73
|
+
return result;
|
|
72
74
|
const obj = {
|
|
73
75
|
...store.unwrap(result),
|
|
74
76
|
// During SSR, functions cannot be serialized, so we need to remove them
|
|
@@ -185,7 +187,9 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
185
187
|
}
|
|
186
188
|
if (!observerResult.isLoading) {
|
|
187
189
|
resolver = null;
|
|
188
|
-
return resolve(
|
|
190
|
+
return resolve(
|
|
191
|
+
hydratableObserverResult(obs.getCurrentQuery(), observerResult)
|
|
192
|
+
);
|
|
189
193
|
}
|
|
190
194
|
setStateWithReconciliation(observerResult);
|
|
191
195
|
});
|
|
@@ -269,6 +273,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
269
273
|
([obs, opts]) => {
|
|
270
274
|
obs.setOptions(opts);
|
|
271
275
|
setStateWithReconciliation(obs.getOptimisticResult(opts));
|
|
276
|
+
refetch();
|
|
272
277
|
},
|
|
273
278
|
{ defer: true }
|
|
274
279
|
)
|
package/build/index.js
CHANGED
|
@@ -68,6 +68,8 @@ function reconcileFn(store, result, reconcileOption, queryHash) {
|
|
|
68
68
|
return { ...result, data: newData };
|
|
69
69
|
}
|
|
70
70
|
var hydratableObserverResult = (query, result) => {
|
|
71
|
+
if (!isServer)
|
|
72
|
+
return result;
|
|
71
73
|
const obj = {
|
|
72
74
|
...unwrap(result),
|
|
73
75
|
// During SSR, functions cannot be serialized, so we need to remove them
|
|
@@ -184,7 +186,9 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
184
186
|
}
|
|
185
187
|
if (!observerResult.isLoading) {
|
|
186
188
|
resolver = null;
|
|
187
|
-
return resolve(
|
|
189
|
+
return resolve(
|
|
190
|
+
hydratableObserverResult(obs.getCurrentQuery(), observerResult)
|
|
191
|
+
);
|
|
188
192
|
}
|
|
189
193
|
setStateWithReconciliation(observerResult);
|
|
190
194
|
});
|
|
@@ -268,6 +272,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
268
272
|
([obs, opts]) => {
|
|
269
273
|
obs.setOptions(opts);
|
|
270
274
|
setStateWithReconciliation(obs.getOptimisticResult(opts));
|
|
275
|
+
refetch();
|
|
271
276
|
},
|
|
272
277
|
{ defer: true }
|
|
273
278
|
)
|
package/package.json
CHANGED
package/src/createBaseQuery.ts
CHANGED
|
@@ -74,6 +74,7 @@ const hydratableObserverResult = <
|
|
|
74
74
|
query: Query<TQueryFnData, TError, TData, TQueryKey>,
|
|
75
75
|
result: QueryObserverResult<TDataHydratable, TError>,
|
|
76
76
|
) => {
|
|
77
|
+
if (!isServer) return result
|
|
77
78
|
const obj: any = {
|
|
78
79
|
...unwrap(result),
|
|
79
80
|
// During SSR, functions cannot be serialized, so we need to remove them
|
|
@@ -255,7 +256,9 @@ export function createBaseQuery<
|
|
|
255
256
|
}
|
|
256
257
|
if (!observerResult.isLoading) {
|
|
257
258
|
resolver = null
|
|
258
|
-
return resolve(
|
|
259
|
+
return resolve(
|
|
260
|
+
hydratableObserverResult(obs.getCurrentQuery(), observerResult),
|
|
261
|
+
)
|
|
259
262
|
}
|
|
260
263
|
|
|
261
264
|
setStateWithReconciliation(observerResult)
|
|
@@ -355,6 +358,7 @@ export function createBaseQuery<
|
|
|
355
358
|
([obs, opts]) => {
|
|
356
359
|
obs.setOptions(opts)
|
|
357
360
|
setStateWithReconciliation(obs.getOptimisticResult(opts))
|
|
361
|
+
refetch()
|
|
358
362
|
},
|
|
359
363
|
{ defer: true },
|
|
360
364
|
),
|