@tanstack/solid-query 5.28.8 → 5.28.12
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 +5 -5
- package/build/dev.js +5 -5
- package/build/index.cjs +5 -5
- package/build/index.js +5 -5
- package/package.json +2 -2
- package/src/createBaseQuery.ts +5 -5
package/build/dev.cjs
CHANGED
|
@@ -99,6 +99,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
99
99
|
}
|
|
100
100
|
return defaultOptions;
|
|
101
101
|
});
|
|
102
|
+
const initialOptions = defaultedOptions();
|
|
102
103
|
const [observer, setObserver] = solidJs.createSignal(
|
|
103
104
|
new Observer(client(), defaultedOptions())
|
|
104
105
|
);
|
|
@@ -188,13 +189,12 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
188
189
|
* Note that this is only invoked on the client, for queries that were originally run on the server.
|
|
189
190
|
*/
|
|
190
191
|
onHydrated(_k, info) {
|
|
191
|
-
const defaultOptions = defaultedOptions();
|
|
192
192
|
if (info.value) {
|
|
193
193
|
queryCore.hydrate(client(), {
|
|
194
194
|
queries: [
|
|
195
195
|
{
|
|
196
|
-
queryKey:
|
|
197
|
-
queryHash:
|
|
196
|
+
queryKey: initialOptions.queryKey,
|
|
197
|
+
queryHash: initialOptions.queryHash,
|
|
198
198
|
state: info.value
|
|
199
199
|
}
|
|
200
200
|
]
|
|
@@ -202,8 +202,8 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
202
202
|
}
|
|
203
203
|
if (unsubscribe)
|
|
204
204
|
return;
|
|
205
|
-
const newOptions = { ...
|
|
206
|
-
if (
|
|
205
|
+
const newOptions = { ...initialOptions };
|
|
206
|
+
if (initialOptions.staleTime || !initialOptions.initialData) {
|
|
207
207
|
newOptions.refetchOnMount = false;
|
|
208
208
|
}
|
|
209
209
|
observer().setOptions(newOptions);
|
package/build/dev.js
CHANGED
|
@@ -98,6 +98,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
98
98
|
}
|
|
99
99
|
return defaultOptions;
|
|
100
100
|
});
|
|
101
|
+
const initialOptions = defaultedOptions();
|
|
101
102
|
const [observer, setObserver] = createSignal(
|
|
102
103
|
new Observer(client(), defaultedOptions())
|
|
103
104
|
);
|
|
@@ -187,13 +188,12 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
187
188
|
* Note that this is only invoked on the client, for queries that were originally run on the server.
|
|
188
189
|
*/
|
|
189
190
|
onHydrated(_k, info) {
|
|
190
|
-
const defaultOptions = defaultedOptions();
|
|
191
191
|
if (info.value) {
|
|
192
192
|
hydrate(client(), {
|
|
193
193
|
queries: [
|
|
194
194
|
{
|
|
195
|
-
queryKey:
|
|
196
|
-
queryHash:
|
|
195
|
+
queryKey: initialOptions.queryKey,
|
|
196
|
+
queryHash: initialOptions.queryHash,
|
|
197
197
|
state: info.value
|
|
198
198
|
}
|
|
199
199
|
]
|
|
@@ -201,8 +201,8 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
201
201
|
}
|
|
202
202
|
if (unsubscribe)
|
|
203
203
|
return;
|
|
204
|
-
const newOptions = { ...
|
|
205
|
-
if (
|
|
204
|
+
const newOptions = { ...initialOptions };
|
|
205
|
+
if (initialOptions.staleTime || !initialOptions.initialData) {
|
|
206
206
|
newOptions.refetchOnMount = false;
|
|
207
207
|
}
|
|
208
208
|
observer().setOptions(newOptions);
|
package/build/index.cjs
CHANGED
|
@@ -99,6 +99,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
99
99
|
}
|
|
100
100
|
return defaultOptions;
|
|
101
101
|
});
|
|
102
|
+
const initialOptions = defaultedOptions();
|
|
102
103
|
const [observer, setObserver] = solidJs.createSignal(
|
|
103
104
|
new Observer(client(), defaultedOptions())
|
|
104
105
|
);
|
|
@@ -188,13 +189,12 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
188
189
|
* Note that this is only invoked on the client, for queries that were originally run on the server.
|
|
189
190
|
*/
|
|
190
191
|
onHydrated(_k, info) {
|
|
191
|
-
const defaultOptions = defaultedOptions();
|
|
192
192
|
if (info.value) {
|
|
193
193
|
queryCore.hydrate(client(), {
|
|
194
194
|
queries: [
|
|
195
195
|
{
|
|
196
|
-
queryKey:
|
|
197
|
-
queryHash:
|
|
196
|
+
queryKey: initialOptions.queryKey,
|
|
197
|
+
queryHash: initialOptions.queryHash,
|
|
198
198
|
state: info.value
|
|
199
199
|
}
|
|
200
200
|
]
|
|
@@ -202,8 +202,8 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
202
202
|
}
|
|
203
203
|
if (unsubscribe)
|
|
204
204
|
return;
|
|
205
|
-
const newOptions = { ...
|
|
206
|
-
if (
|
|
205
|
+
const newOptions = { ...initialOptions };
|
|
206
|
+
if (initialOptions.staleTime || !initialOptions.initialData) {
|
|
207
207
|
newOptions.refetchOnMount = false;
|
|
208
208
|
}
|
|
209
209
|
observer().setOptions(newOptions);
|
package/build/index.js
CHANGED
|
@@ -98,6 +98,7 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
98
98
|
}
|
|
99
99
|
return defaultOptions;
|
|
100
100
|
});
|
|
101
|
+
const initialOptions = defaultedOptions();
|
|
101
102
|
const [observer, setObserver] = createSignal(
|
|
102
103
|
new Observer(client(), defaultedOptions())
|
|
103
104
|
);
|
|
@@ -187,13 +188,12 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
187
188
|
* Note that this is only invoked on the client, for queries that were originally run on the server.
|
|
188
189
|
*/
|
|
189
190
|
onHydrated(_k, info) {
|
|
190
|
-
const defaultOptions = defaultedOptions();
|
|
191
191
|
if (info.value) {
|
|
192
192
|
hydrate(client(), {
|
|
193
193
|
queries: [
|
|
194
194
|
{
|
|
195
|
-
queryKey:
|
|
196
|
-
queryHash:
|
|
195
|
+
queryKey: initialOptions.queryKey,
|
|
196
|
+
queryHash: initialOptions.queryHash,
|
|
197
197
|
state: info.value
|
|
198
198
|
}
|
|
199
199
|
]
|
|
@@ -201,8 +201,8 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
201
201
|
}
|
|
202
202
|
if (unsubscribe)
|
|
203
203
|
return;
|
|
204
|
-
const newOptions = { ...
|
|
205
|
-
if (
|
|
204
|
+
const newOptions = { ...initialOptions };
|
|
205
|
+
if (initialOptions.staleTime || !initialOptions.initialData) {
|
|
206
206
|
newOptions.refetchOnMount = false;
|
|
207
207
|
}
|
|
208
208
|
observer().setOptions(newOptions);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query",
|
|
3
|
-
"version": "5.28.
|
|
3
|
+
"version": "5.28.12",
|
|
4
4
|
"description": "Primitives for managing, caching and syncing asynchronous and remote data in Solid",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"solid-js": "^1.8.14",
|
|
51
|
-
"@tanstack/query-core": "5.28.
|
|
51
|
+
"@tanstack/query-core": "5.28.12"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"tsup-preset-solid": "^2.2.0",
|
package/src/createBaseQuery.ts
CHANGED
|
@@ -138,6 +138,7 @@ export function createBaseQuery<
|
|
|
138
138
|
}
|
|
139
139
|
return defaultOptions
|
|
140
140
|
})
|
|
141
|
+
const initialOptions = defaultedOptions()
|
|
141
142
|
|
|
142
143
|
const [observer, setObserver] = createSignal(
|
|
143
144
|
new Observer(client(), defaultedOptions()),
|
|
@@ -254,13 +255,12 @@ export function createBaseQuery<
|
|
|
254
255
|
* Note that this is only invoked on the client, for queries that were originally run on the server.
|
|
255
256
|
*/
|
|
256
257
|
onHydrated(_k, info) {
|
|
257
|
-
const defaultOptions = defaultedOptions()
|
|
258
258
|
if (info.value) {
|
|
259
259
|
hydrate(client(), {
|
|
260
260
|
queries: [
|
|
261
261
|
{
|
|
262
|
-
queryKey:
|
|
263
|
-
queryHash:
|
|
262
|
+
queryKey: initialOptions.queryKey,
|
|
263
|
+
queryHash: initialOptions.queryHash,
|
|
264
264
|
state: info.value,
|
|
265
265
|
},
|
|
266
266
|
],
|
|
@@ -272,8 +272,8 @@ export function createBaseQuery<
|
|
|
272
272
|
* Do not refetch query on mount if query was fetched on server,
|
|
273
273
|
* even if `staleTime` is not set.
|
|
274
274
|
*/
|
|
275
|
-
const newOptions = { ...
|
|
276
|
-
if (
|
|
275
|
+
const newOptions = { ...initialOptions }
|
|
276
|
+
if (initialOptions.staleTime || !initialOptions.initialData) {
|
|
277
277
|
newOptions.refetchOnMount = false
|
|
278
278
|
}
|
|
279
279
|
// Setting the options as an immutable object to prevent
|