overmind
Version:
Frictionless state management
15 lines (13 loc) • 482 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
exports.lazy = lazy;
//# sourceMappingURL=lazy.js.map