@ventlio/tanstack-query 0.2.56 → 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.
@@ -10,9 +10,9 @@ const useReactNativeEnv = () => {
10
10
  react.useEffect(() => {
11
11
  const config = queryClient.getQueryData(['config']);
12
12
  const loadReactNativeEnvIfNeeded = async () => {
13
- if (config?.options?.environment === 'app') {
14
- console.log('is app');
15
- const { API_URL, API_TIMEOUT } = await require('react-native-dotenv');
13
+ if (config?.options?.context === 'app') {
14
+ const API_URL = config.options.environments?.appBaseUrl;
15
+ const API_TIMEOUT = config.options.environments?.appTimeout;
16
16
  setAppUrl(API_URL);
17
17
  setAppTimeout(API_TIMEOUT);
18
18
  }
package/dist/index.mjs CHANGED
@@ -24,9 +24,9 @@ const useReactNativeEnv = () => {
24
24
  useEffect(() => {
25
25
  const config = queryClient.getQueryData(['config']);
26
26
  const loadReactNativeEnvIfNeeded = async () => {
27
- if (config?.options?.environment === 'app') {
28
- console.log('is app');
29
- const { API_URL, API_TIMEOUT } = await require('react-native-dotenv');
27
+ if (config?.options?.context === 'app') {
28
+ const API_URL = config.options.environments?.appBaseUrl;
29
+ const API_TIMEOUT = config.options.environments?.appTimeout;
30
30
  setAppUrl(API_URL);
31
31
  setAppTimeout(API_TIMEOUT);
32
32
  }
@@ -1,6 +1,10 @@
1
1
  import type { RawAxiosRequestHeaders } from 'axios';
2
2
  export interface BootstrapQueryRequest {
3
- environment: 'app' | 'web' | 'electronjs';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ventlio/tanstack-query",
3
- "version": "0.2.56",
3
+ "version": "0.2.57",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "contributors": [
@@ -12,9 +12,9 @@ export const useReactNativeEnv = () => {
12
12
  const config = queryClient.getQueryData<TanstackQueryConfig>(['config']);
13
13
 
14
14
  const loadReactNativeEnvIfNeeded = async () => {
15
- if (config?.options?.environment === 'app') {
16
- console.log('is app');
17
- const { API_URL, API_TIMEOUT } = await require('react-native-dotenv');
15
+ if (config?.options?.context === 'app') {
16
+ const API_URL = config.options.environments?.appBaseUrl;
17
+ const API_TIMEOUT = config.options.environments?.appTimeout;
18
18
 
19
19
  setAppUrl(API_URL);
20
20
  setAppTimeout(API_TIMEOUT);
@@ -1,7 +1,11 @@
1
1
  import type { RawAxiosRequestHeaders } from 'axios';
2
2
 
3
3
  export interface BootstrapQueryRequest {
4
- environment: 'app' | 'web' | 'electronjs';
4
+ environments?: {
5
+ appBaseUrl: string;
6
+ appTimeout: number;
7
+ };
8
+ context?: 'app' | 'web' | 'electronjs';
5
9
  }
6
10
 
7
11
  export interface TanstackQueryConfig {