@ventlio/tanstack-query 0.2.55 → 0.2.57
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/useReactNativeEnv.js +3 -2
- package/dist/config/useReactNativeEnv.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.ts +5 -1
- package/package.json +1 -1
- package/src/config/useReactNativeEnv.ts +3 -2
- package/src/types/index.ts +5 -1
|
@@ -10,8 +10,9 @@ const useReactNativeEnv = () => {
|
|
|
10
10
|
react.useEffect(() => {
|
|
11
11
|
const config = queryClient.getQueryData(['config']);
|
|
12
12
|
const loadReactNativeEnvIfNeeded = async () => {
|
|
13
|
-
if (config?.options?.
|
|
14
|
-
const
|
|
13
|
+
if (config?.options?.context === 'app') {
|
|
14
|
+
const API_URL = config.options.environments?.appBaseUrl;
|
|
15
|
+
const API_TIMEOUT = config.options.environments?.appTimeout;
|
|
15
16
|
setAppUrl(API_URL);
|
|
16
17
|
setAppTimeout(API_TIMEOUT);
|
|
17
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactNativeEnv.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useReactNativeEnv.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -24,8 +24,9 @@ const useReactNativeEnv = () => {
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
const config = queryClient.getQueryData(['config']);
|
|
26
26
|
const loadReactNativeEnvIfNeeded = async () => {
|
|
27
|
-
if (config?.options?.
|
|
28
|
-
const
|
|
27
|
+
if (config?.options?.context === 'app') {
|
|
28
|
+
const API_URL = config.options.environments?.appBaseUrl;
|
|
29
|
+
const API_TIMEOUT = config.options.environments?.appTimeout;
|
|
29
30
|
setAppUrl(API_URL);
|
|
30
31
|
setAppTimeout(API_TIMEOUT);
|
|
31
32
|
}
|
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/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { RawAxiosRequestHeaders } from 'axios';
|
|
2
2
|
export interface BootstrapQueryRequest {
|
|
3
|
-
|
|
3
|
+
environments?: {
|
|
4
|
+
appBaseUrl: string;
|
|
5
|
+
appTimeout: number;
|
|
6
|
+
};
|
|
7
|
+
context?: 'app' | 'web' | 'electronjs';
|
|
4
8
|
}
|
|
5
9
|
export interface TanstackQueryConfig {
|
|
6
10
|
headers: RawAxiosRequestHeaders;
|
package/package.json
CHANGED
|
@@ -12,8 +12,9 @@ export const useReactNativeEnv = () => {
|
|
|
12
12
|
const config = queryClient.getQueryData<TanstackQueryConfig>(['config']);
|
|
13
13
|
|
|
14
14
|
const loadReactNativeEnvIfNeeded = async () => {
|
|
15
|
-
if (config?.options?.
|
|
16
|
-
const
|
|
15
|
+
if (config?.options?.context === 'app') {
|
|
16
|
+
const API_URL = config.options.environments?.appBaseUrl;
|
|
17
|
+
const API_TIMEOUT = config.options.environments?.appTimeout;
|
|
17
18
|
|
|
18
19
|
setAppUrl(API_URL);
|
|
19
20
|
setAppTimeout(API_TIMEOUT);
|
package/src/types/index.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { RawAxiosRequestHeaders } from 'axios';
|
|
2
2
|
|
|
3
3
|
export interface BootstrapQueryRequest {
|
|
4
|
-
|
|
4
|
+
environments?: {
|
|
5
|
+
appBaseUrl: string;
|
|
6
|
+
appTimeout: number;
|
|
7
|
+
};
|
|
8
|
+
context?: 'app' | 'web' | 'electronjs';
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
export interface TanstackQueryConfig {
|