mirror of
https://github.com/Mastermindzh/react-starter-kit.git
synced 2025-08-23 09:35:01 +02:00
Moved config to infrastructure :)
This commit is contained in:
15
src/infrastructure/config/config.ts
Normal file
15
src/infrastructure/config/config.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import deepmerge from "deepmerge";
|
||||
|
||||
/**
|
||||
* 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 = window.mergedConfig;
|
Reference in New Issue
Block a user