overmind
Version:
Frictionless state management
14 lines (13 loc) • 477 B
JavaScript
//#region src/config/lazy.ts
function lazy(configurations) {
return { actions: { lazy: { loadConfig({ state, execution, addNamespace }, key) {
const configToLoad = configurations[key];
const namespacePath = execution.namespacePath.slice(0, execution.namespacePath.length - 1).concat(key);
return configToLoad().then((loadedConfig) => {
addNamespace(loadedConfig, namespacePath, state);
});
} } } };
}
//#endregion
export { lazy };
//# sourceMappingURL=lazy.js.map