flowie
Version:
Library for creating, and working with flows
19 lines • 809 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const flowie_1 = require("./flowie");
function executeFlow(flowieContainer, flow, initialValue) {
const [firstFlowItemName, ...otherFlowItemNames] = flow.pipe;
const firstFlowItem = flowieContainer.functionsContainer[firstFlowItemName];
const flowieFlow = otherFlowItemNames
.map(getFunctionsFromContainer, flowieContainer)
.reduce(buildPipeFlow, flowie_1.default(firstFlowItem));
return flowieFlow.executeFlow(initialValue);
}
exports.default = executeFlow;
function getFunctionsFromContainer(functionName) {
return this.functionsContainer[functionName];
}
function buildPipeFlow(flowie, nextFunctionToPipe) {
return flowie.pipe(nextFunctionToPipe);
}
//# sourceMappingURL=executeFlow.js.map