UNPKG

reshuffle

Version:

Reshuffle is a fast, unopinionated, minimalist integration framework

22 lines 690 B
"use strict"; exports.__esModule = true; var SimplePipe = /** @class */ (function () { function SimplePipe() { this._chain = []; } SimplePipe.prototype.makePromises = function (payload) { return this._chain.reduce(function (chain, handler) { return chain.then(function (payload) { return handler(payload); }); }, Promise.resolve()); }; SimplePipe.prototype.flow = function (payload) { return this.makePromises(payload); }; SimplePipe.prototype.pipe = function (f) { this._chain.push(f); return this; }; return SimplePipe; }()); exports["default"] = SimplePipe; //# sourceMappingURL=Pipes.js.map