Merge pull request #2922 from matrix-org/travis/merge-config

Add a function to append/overwrite objects in the config on the fly
This commit is contained in:
Travis Ralston
2019-04-16 09:14:24 -06:00
committed by GitHub

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;