Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2922 from matrix-org/travis/merge-config
Browse files Browse the repository at this point in the history
Add a function to append/overwrite objects in the config on the fly
  • Loading branch information
turt2live authored Apr 16, 2019
2 parents f6154bc + a11cf88 commit 65020a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SdkConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 65020a5

Please sign in to comment.