Echo JS 0.11.0

<~>

tracker1 1519 days ago. link 1 point
On #2, when using a getter that calls a function that can throw, it's a good idea to wrap in a try/catch as property getting should not be a point where an application throws in practice.

You could alternatively use the following pattern, and have your application loader parse and inject the configuration for the rest of your application to utilize...

    export const configuration = {};

    export function setConfiguration(data) {
      Object.keys(configuration).forEach(c => {
        delete configuration[c];
      });
      Object.assign(configuration, data);
    };

    export default configuration;