overmind
Version:
Frictionless state management
18 lines • 648 B
JavaScript
export 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);
});
},
},
},
};
}
//# sourceMappingURL=lazy.js.map