We run some scripts upon starting an application that make use of variables set up in the cfg-file. It seems that these are not available on the global app-object when executing main.es6. Is this by design, or a bug? And if it is the first, is there a work around (e.g. a life cycle event I can hook unto)?
Maybe as an extension of this: We’re also using eventListeners in our application, and those are initiated during main.js. It seems that the callback functions never get a correct global app object (name and version are set, but config remains an empty object).
I suspect this may be because how event listeners work behind the hood, i.e. is there some threading where the app-object is copied, and therefore aren’t updated with the “proper” config variables later on? (I don’t actually know how eventLib works behind the hood, so this is pure speculation on my part.)
Just a little extra info, the app object in question during main.js execution:
What is the sequence of reading config vs. the “application” event like? Could main.js be running before the config file gets parsed? Later in the application execution the config parameters seem to be correctly set.