JSFiddle - React, Tailwind, and code Playground

by Sascha

JavaScript

var databoxPath = "123/";

var GetCurrentProductionApiConfig = function() {
this.URL = {
    GetStart: databoxPath + 'GetCurrentProduction?returnValue=start&',
    GetEnd: databoxPath + 'GetCurrentProduction?returnValue=end&',
    Get: databoxPath + 'GetCurrentProduction?returnValue=start&'
  }
};
GetCurrentProductionApiConfig.prototype.updateProps= function(newPath) {
  this.URL.GetStart = newPath + 'GetCurrentProduction?returnValue=start&';
  this.URL.GetEnd = newPath + 'GetCurrentProduction?returnValue=end&';
  this.URL.Get = newPath + 'GetCurrentProduction?returnValue=start&';
}

var getCurrentProductionApiConfig = new GetCurrentProductionApiConfig();
getCurrentProductionApiConfig.updateProps("bla/");

console.log(getCurrentProductionApiConfig);
console.log(getCurrentProductionApiConfig.URL.GetStart);