Files
galaxy/client/src/utils/genericConfig.js
T
2020-08-11 10:26:05 -04:00

18 lines
421 B
JavaScript

/**
* Generic config storage object
*/
export function buildConfig(defaultConfigs = {}) {
const storage = Object.assign({}, defaultConfigs);
return new Proxy(storage, {
get(target, propName) {
if (propName in target) {
return target[propName];
} else {
console.warn("Requested missing config prop", propName);
}
},
});
}