app-builder
Advanced tools
Comparing version 3.0.0 to 3.0.1
30
index.js
@@ -32,16 +32,13 @@ 'use strict'; | ||
var ctx = undefined, | ||
env = undefined; | ||
return (_ref = []).concat.apply(_ref, arguments) //flatten arguments | ||
.reduceRight(function (next, mw, i) { | ||
return function (environment) { | ||
if (i === 0) { | ||
// capture context and environment when reduced method is invoked. | ||
ctx = this; | ||
env = environment; | ||
} | ||
return Promise.resolve(mw.call(ctx, env, env.next = next)); | ||
return (_ref = []).concat.apply(_ref, arguments) //flatten arguments | ||
.reduceRight(function (next, mw) { | ||
return function (env) { | ||
var _this = this; | ||
env.next = function () { | ||
return next.call(_this, env); | ||
}; | ||
return Promise.resolve(mw.call(this, env, env.next)); | ||
}; | ||
// seed with noop | ||
}, noop); | ||
}, noop); // seed with noop | ||
} | ||
@@ -62,3 +59,3 @@ | ||
} | ||
return AppBuilder.compose(this.middleware); | ||
return compose(this.middleware); | ||
} | ||
@@ -74,7 +71,2 @@ }, { | ||
} | ||
}], [{ | ||
key: 'compose', | ||
get: function get() { | ||
return compose; | ||
} | ||
}]); | ||
@@ -81,0 +73,0 @@ |
{ | ||
"name": "app-builder", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "simple promise based middleware", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
"composition", | ||
"pipline", | ||
"pipeline", | ||
"async", | ||
@@ -24,0 +24,0 @@ "middleware", |
5192
61