@ventlio/tanstack-query 0.2.20 → 0.2.21
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/dist/config/useQueryBaseURL.js +5 -2
- package/dist/config/useQueryBaseURL.js.map +1 -1
- package/dist/config/useQueryHeaders.js +2 -2
- package/dist/config/useQueryTimeout.js +2 -2
- package/dist/index.mjs +9 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/config/useQueryBaseURL.ts +7 -3
- package/src/config/useQueryHeaders.ts +3 -3
- package/src/config/useQueryTimeout.ts +4 -3
|
@@ -8,8 +8,11 @@ const useQueryBaseURL = () => {
|
|
|
8
8
|
const queryClient = reactQuery.useQueryClient();
|
|
9
9
|
const setQueryBaseUrl = (newBaseUrl) => {
|
|
10
10
|
queryClient.setQueryData(['config'], (config) => {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const newConfig = {
|
|
12
|
+
...config,
|
|
13
|
+
baseURL: newBaseUrl,
|
|
14
|
+
};
|
|
15
|
+
return newConfig;
|
|
13
16
|
});
|
|
14
17
|
};
|
|
15
18
|
return { baseURL, setQueryBaseUrl };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryBaseURL.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useQueryBaseURL.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -8,8 +8,8 @@ const useQueryHeaders = () => {
|
|
|
8
8
|
const queryClient = reactQuery.useQueryClient();
|
|
9
9
|
const setQueryHeaders = (newHeaders) => {
|
|
10
10
|
queryClient.setQueryData(['config'], (config) => {
|
|
11
|
-
config
|
|
12
|
-
return
|
|
11
|
+
const newConfig = { ...config, headers: newHeaders };
|
|
12
|
+
return newConfig;
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
return { headers, setQueryHeaders };
|
|
@@ -8,8 +8,8 @@ const useQueryTimeout = () => {
|
|
|
8
8
|
const queryClient = reactQuery.useQueryClient();
|
|
9
9
|
const setQueryTimeout = (newTimeout) => {
|
|
10
10
|
queryClient.setQueryData(['config'], (config) => {
|
|
11
|
-
config
|
|
12
|
-
return
|
|
11
|
+
const newConfig = { ...config, timeout: newTimeout };
|
|
12
|
+
return newConfig;
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
return { timeout, setQueryTimeout };
|
package/dist/index.mjs
CHANGED
|
@@ -13,8 +13,11 @@ const useQueryBaseURL = () => {
|
|
|
13
13
|
const queryClient = useQueryClient();
|
|
14
14
|
const setQueryBaseUrl = (newBaseUrl) => {
|
|
15
15
|
queryClient.setQueryData(['config'], (config) => {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const newConfig = {
|
|
17
|
+
...config,
|
|
18
|
+
baseURL: newBaseUrl,
|
|
19
|
+
};
|
|
20
|
+
return newConfig;
|
|
18
21
|
});
|
|
19
22
|
};
|
|
20
23
|
return { baseURL, setQueryBaseUrl };
|
|
@@ -25,8 +28,8 @@ const useQueryHeaders = () => {
|
|
|
25
28
|
const queryClient = useQueryClient();
|
|
26
29
|
const setQueryHeaders = (newHeaders) => {
|
|
27
30
|
queryClient.setQueryData(['config'], (config) => {
|
|
28
|
-
config
|
|
29
|
-
return
|
|
31
|
+
const newConfig = { ...config, headers: newHeaders };
|
|
32
|
+
return newConfig;
|
|
30
33
|
});
|
|
31
34
|
};
|
|
32
35
|
return { headers, setQueryHeaders };
|
|
@@ -37,8 +40,8 @@ const useQueryTimeout = () => {
|
|
|
37
40
|
const queryClient = useQueryClient();
|
|
38
41
|
const setQueryTimeout = (newTimeout) => {
|
|
39
42
|
queryClient.setQueryData(['config'], (config) => {
|
|
40
|
-
config
|
|
41
|
-
return
|
|
43
|
+
const newConfig = { ...config, timeout: newTimeout };
|
|
44
|
+
return newConfig;
|
|
42
45
|
});
|
|
43
46
|
};
|
|
44
47
|
return { timeout, setQueryTimeout };
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -7,9 +7,13 @@ export const useQueryBaseURL = (): IUseQueryBaseURL => {
|
|
|
7
7
|
const queryClient = useQueryClient();
|
|
8
8
|
|
|
9
9
|
const setQueryBaseUrl = (newBaseUrl: TanstackQueryConfig['baseURL']) => {
|
|
10
|
-
queryClient.setQueryData<TanstackQueryConfig>(['config'], (config) => {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
queryClient.setQueryData<TanstackQueryConfig>(['config'], (config): any => {
|
|
11
|
+
const newConfig = {
|
|
12
|
+
...config,
|
|
13
|
+
baseURL: newBaseUrl,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return newConfig;
|
|
13
17
|
});
|
|
14
18
|
};
|
|
15
19
|
|
|
@@ -7,9 +7,9 @@ export const useQueryHeaders = (): IUseQueryHeaders => {
|
|
|
7
7
|
const queryClient = useQueryClient();
|
|
8
8
|
|
|
9
9
|
const setQueryHeaders = (newHeaders: TanstackQueryConfig['headers']) => {
|
|
10
|
-
queryClient.setQueryData<TanstackQueryConfig>(['config'], (config) => {
|
|
11
|
-
|
|
12
|
-
return
|
|
10
|
+
queryClient.setQueryData<TanstackQueryConfig>(['config'], (config): any => {
|
|
11
|
+
const newConfig = { ...config, headers: newHeaders };
|
|
12
|
+
return newConfig;
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -7,9 +7,10 @@ export const useQueryTimeout = (): IUseQueryTimeout => {
|
|
|
7
7
|
const queryClient = useQueryClient();
|
|
8
8
|
|
|
9
9
|
const setQueryTimeout = (newTimeout: TanstackQueryConfig['timeout']) => {
|
|
10
|
-
queryClient.setQueryData<TanstackQueryConfig>(['config'], (config) => {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
queryClient.setQueryData<TanstackQueryConfig>(['config'], (config): any => {
|
|
11
|
+
const newConfig = { ...config, timeout: newTimeout };
|
|
12
|
+
|
|
13
|
+
return newConfig;
|
|
13
14
|
});
|
|
14
15
|
};
|
|
15
16
|
|