dipe
Version:
> Let your data flow.
19 lines (18 loc) • 604 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const pipeline_1 = require("./utils/pipeline");
function runLazy(processors, options = {}) {
const data = { current: null };
const errors = [];
const read = (opts) => {
try {
data.current = (0, pipeline_1.pipeline)(processors, Object.assign(Object.assign({}, options), opts));
/* eslint-disable @typescript-eslint/no-explicit-any */
}
catch (e) {
errors.push(e.message);
}
};
return [{ data, errors }, read];
}
exports.default = runLazy;
;