mirror of
https://github.com/Mastermindzh/react-starter-kit.git
synced 2025-08-23 09:35:01 +02:00
17 lines
441 B
TypeScript
17 lines
441 B
TypeScript
import deepmerge from "deepmerge";
|
|
import { RunTimeConfig } from "./RunTimeConfig";
|
|
|
|
/**
|
|
* gets and merges both the regular config and the override config from the window
|
|
* into window.mergedConfig
|
|
*/
|
|
export const mergeConfigs = () => {
|
|
if (!window.mergedConfig) {
|
|
window.mergedConfig = deepmerge(window.defaultConfig, window.configOverride ?? {});
|
|
}
|
|
};
|
|
|
|
mergeConfigs();
|
|
|
|
export const Config: RunTimeConfig = window.mergedConfig;
|