Add a function to append/overwrite objects in the config on the fly

Intended to be used to overwrite settings which may be calculated rather than provided.
pull/21833/head
Travis Ralston 2019-04-15 14:46:00 -06:00
parent f6154bc7cd
commit a11cf88e07
1 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,12 @@ class SdkConfig {
static unset() {
global.mxReactSdkConfig = undefined;
}
static add(cfg) {
const liveConfig = SdkConfig.get();
const newConfig = Object.assign({}, liveConfig, cfg);
SdkConfig.put(newConfig);
}
}
module.exports = SdkConfig;