@tanstack/solid-query 5.0.0-rc.6 → 5.0.0-rc.8
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 +2 -2
- package/build/dev.js +2 -2
- package/build/index.cjs +2 -2
- package/build/index.d.cts +2 -2
- package/build/index.d.ts +2 -2
- package/build/index.js +2 -2
- package/package.json +1 -1
- package/src/QueryClient.ts +2 -2
- package/src/__tests__/createQuery.test.tsx +1 -0
- package/src/createBaseQuery.ts +2 -2
package/build/dev.cjs
CHANGED
|
@@ -83,7 +83,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
83
83
|
const client = solidJs.createMemo(() => exports.useQueryClient(queryClient?.()));
|
|
84
84
|
const isRestoring = exports.useIsRestoring();
|
|
85
85
|
const defaultedOptions = solidJs.createMemo(
|
|
86
|
-
() => solidJs.mergeProps(client()
|
|
86
|
+
() => solidJs.mergeProps(client()?.defaultQueryOptions(options()) || {}, {
|
|
87
87
|
get _optimisticResults() {
|
|
88
88
|
return isRestoring() ? "isRestoring" : "optimistic";
|
|
89
89
|
},
|
|
@@ -124,7 +124,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
124
124
|
return reconcileFn(
|
|
125
125
|
store,
|
|
126
126
|
result,
|
|
127
|
-
reconcileOptions === void 0 ?
|
|
127
|
+
reconcileOptions === void 0 ? false : reconcileOptions
|
|
128
128
|
);
|
|
129
129
|
});
|
|
130
130
|
if (queryResource()?.data && result.data && !queryResource.loading && isRestoring())
|
package/build/dev.js
CHANGED
|
@@ -82,7 +82,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
82
82
|
const client = createMemo(() => useQueryClient(queryClient?.()));
|
|
83
83
|
const isRestoring = useIsRestoring();
|
|
84
84
|
const defaultedOptions = createMemo(
|
|
85
|
-
() => mergeProps(client()
|
|
85
|
+
() => mergeProps(client()?.defaultQueryOptions(options()) || {}, {
|
|
86
86
|
get _optimisticResults() {
|
|
87
87
|
return isRestoring() ? "isRestoring" : "optimistic";
|
|
88
88
|
},
|
|
@@ -123,7 +123,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
123
123
|
return reconcileFn(
|
|
124
124
|
store,
|
|
125
125
|
result,
|
|
126
|
-
reconcileOptions === void 0 ?
|
|
126
|
+
reconcileOptions === void 0 ? false : reconcileOptions
|
|
127
127
|
);
|
|
128
128
|
});
|
|
129
129
|
if (queryResource()?.data && result.data && !queryResource.loading && isRestoring())
|
package/build/index.cjs
CHANGED
|
@@ -83,7 +83,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
83
83
|
const client = solidJs.createMemo(() => exports.useQueryClient(queryClient?.()));
|
|
84
84
|
const isRestoring = exports.useIsRestoring();
|
|
85
85
|
const defaultedOptions = solidJs.createMemo(
|
|
86
|
-
() => solidJs.mergeProps(client()
|
|
86
|
+
() => solidJs.mergeProps(client()?.defaultQueryOptions(options()) || {}, {
|
|
87
87
|
get _optimisticResults() {
|
|
88
88
|
return isRestoring() ? "isRestoring" : "optimistic";
|
|
89
89
|
},
|
|
@@ -124,7 +124,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
124
124
|
return reconcileFn(
|
|
125
125
|
store,
|
|
126
126
|
result,
|
|
127
|
-
reconcileOptions === void 0 ?
|
|
127
|
+
reconcileOptions === void 0 ? false : reconcileOptions
|
|
128
128
|
);
|
|
129
129
|
});
|
|
130
130
|
if (queryResource()?.data && result.data && !queryResource.loading && isRestoring())
|
package/build/index.d.cts
CHANGED
|
@@ -9,7 +9,7 @@ interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TD
|
|
|
9
9
|
* Set this to a reconciliation key to enable reconciliation between query results.
|
|
10
10
|
* Set this to `false` to disable reconciliation between query results.
|
|
11
11
|
* Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic.
|
|
12
|
-
* Defaults reconciliation
|
|
12
|
+
* Defaults reconciliation to false.
|
|
13
13
|
*/
|
|
14
14
|
reconcile?: string | false | ((oldData: TData | undefined, newData: TData) => TData);
|
|
15
15
|
}
|
|
@@ -18,7 +18,7 @@ interface InfiniteQueryObserverOptions<TQueryFnData = unknown, TError = DefaultE
|
|
|
18
18
|
* Set this to a reconciliation key to enable reconciliation between query results.
|
|
19
19
|
* Set this to `false` to disable reconciliation between query results.
|
|
20
20
|
* Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic.
|
|
21
|
-
* Defaults reconciliation
|
|
21
|
+
* Defaults reconciliation to false.
|
|
22
22
|
*/
|
|
23
23
|
reconcile?: string | false | ((oldData: TData | undefined, newData: TData) => TData);
|
|
24
24
|
}
|
package/build/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TD
|
|
|
9
9
|
* Set this to a reconciliation key to enable reconciliation between query results.
|
|
10
10
|
* Set this to `false` to disable reconciliation between query results.
|
|
11
11
|
* Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic.
|
|
12
|
-
* Defaults reconciliation
|
|
12
|
+
* Defaults reconciliation to false.
|
|
13
13
|
*/
|
|
14
14
|
reconcile?: string | false | ((oldData: TData | undefined, newData: TData) => TData);
|
|
15
15
|
}
|
|
@@ -18,7 +18,7 @@ interface InfiniteQueryObserverOptions<TQueryFnData = unknown, TError = DefaultE
|
|
|
18
18
|
* Set this to a reconciliation key to enable reconciliation between query results.
|
|
19
19
|
* Set this to `false` to disable reconciliation between query results.
|
|
20
20
|
* Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic.
|
|
21
|
-
* Defaults reconciliation
|
|
21
|
+
* Defaults reconciliation to false.
|
|
22
22
|
*/
|
|
23
23
|
reconcile?: string | false | ((oldData: TData | undefined, newData: TData) => TData);
|
|
24
24
|
}
|
package/build/index.js
CHANGED
|
@@ -82,7 +82,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
82
82
|
const client = createMemo(() => useQueryClient(queryClient?.()));
|
|
83
83
|
const isRestoring = useIsRestoring();
|
|
84
84
|
const defaultedOptions = createMemo(
|
|
85
|
-
() => mergeProps(client()
|
|
85
|
+
() => mergeProps(client()?.defaultQueryOptions(options()) || {}, {
|
|
86
86
|
get _optimisticResults() {
|
|
87
87
|
return isRestoring() ? "isRestoring" : "optimistic";
|
|
88
88
|
},
|
|
@@ -123,7 +123,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
123
123
|
return reconcileFn(
|
|
124
124
|
store,
|
|
125
125
|
result,
|
|
126
|
-
reconcileOptions === void 0 ?
|
|
126
|
+
reconcileOptions === void 0 ? false : reconcileOptions
|
|
127
127
|
);
|
|
128
128
|
});
|
|
129
129
|
if (queryResource()?.data && result.data && !queryResource.loading && isRestoring())
|
package/package.json
CHANGED
package/src/QueryClient.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface QueryObserverOptions<
|
|
|
30
30
|
* Set this to a reconciliation key to enable reconciliation between query results.
|
|
31
31
|
* Set this to `false` to disable reconciliation between query results.
|
|
32
32
|
* Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic.
|
|
33
|
-
* Defaults reconciliation
|
|
33
|
+
* Defaults reconciliation to false.
|
|
34
34
|
*/
|
|
35
35
|
reconcile?:
|
|
36
36
|
| string
|
|
@@ -60,7 +60,7 @@ export interface InfiniteQueryObserverOptions<
|
|
|
60
60
|
* Set this to a reconciliation key to enable reconciliation between query results.
|
|
61
61
|
* Set this to `false` to disable reconciliation between query results.
|
|
62
62
|
* Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic.
|
|
63
|
-
* Defaults reconciliation
|
|
63
|
+
* Defaults reconciliation to false.
|
|
64
64
|
*/
|
|
65
65
|
reconcile?:
|
|
66
66
|
| string
|
package/src/createBaseQuery.ts
CHANGED
|
@@ -111,7 +111,7 @@ export function createBaseQuery<
|
|
|
111
111
|
const isRestoring = useIsRestoring()
|
|
112
112
|
|
|
113
113
|
const defaultedOptions = createMemo(() =>
|
|
114
|
-
mergeProps(client()
|
|
114
|
+
mergeProps(client()?.defaultQueryOptions(options()) || {}, {
|
|
115
115
|
get _optimisticResults() {
|
|
116
116
|
return isRestoring() ? 'isRestoring' : 'optimistic'
|
|
117
117
|
},
|
|
@@ -167,7 +167,7 @@ export function createBaseQuery<
|
|
|
167
167
|
return reconcileFn(
|
|
168
168
|
store,
|
|
169
169
|
result,
|
|
170
|
-
reconcileOptions === undefined ?
|
|
170
|
+
reconcileOptions === undefined ? false : reconcileOptions,
|
|
171
171
|
)
|
|
172
172
|
})
|
|
173
173
|
// If the query has data we dont suspend but instead mutate the resource
|