How i use config variable before it's initialized in React Js?

Viewed 37

So, This is my config.js file And My question is in this getEnData function some logic is happening But I need below BASE_URL in that file but how i use because before it's initialisation that function calling is happening.

config.js - File

import { getEnData } from 'utils';

export const BASE_URL = NODE_ENV === 'DEVELOPMENT' ? 'test url' : API_URL;

Not: So How i fixed that i can't use static string there because if in future url changes then i need to change two places that's why.

Any help would be appreciated, Thank You :)

0 Answers
Related