@@ -23,6 +23,10 @@ const assertLoaded = () => {
23
23
return loadedConfig ;
24
24
} ;
25
25
26
+ /**
27
+ * Reads and validates app-config, using the default loading strategy.
28
+ * Same as `loadValidatedConfig` but stores loaded config in the `config` export.
29
+ */
26
30
export async function loadConfig (
27
31
options ?: ConfigLoadingOptions ,
28
32
schemaOptions ?: SchemaLoadingOptions ,
@@ -42,6 +46,11 @@ export async function loadConfig(
42
46
return config ;
43
47
}
44
48
49
+ /**
50
+ * Singleton for loaded configuration, when `loadConfig` has completed successfully.
51
+ *
52
+ * Reading properties on this object before `loadConfig` completes will throw errors.
53
+ */
45
54
export const config : ExportedConfig = new Proxy (
46
55
{
47
56
APP_CONFIG_WAS_NOT_LOADED_YET_LOOK_AT_THE_DOCS : true ,
@@ -81,7 +90,7 @@ export const config: ExportedConfig = new Proxy(
81
90
export default config ;
82
91
83
92
/**
84
- * Only available when using @app-config/webpack. Validates configuration using AJV.
93
+ * ONLY available when using @app-config/webpack. Validates configuration using AJV.
85
94
*/
86
95
export const validateConfig : ValidateFunction < ExportedConfig > = null as any ; // eslint-disable-line
87
96
@@ -138,7 +147,7 @@ export {
138
147
defaultMetaExtensions ,
139
148
} from '@app-config/default-extensions' ;
140
149
141
- /** @hidden */
150
+ /** @hidden Please don't rely on this. */
142
151
export function resetConfigInternal ( ) {
143
152
loadedConfig = undefined ;
144
153
}
0 commit comments