Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created September 6, 2011 18:33
Show Gist options
  • Save Raynos/1198539 to your computer and use it in GitHub Desktop.
Save Raynos/1198539 to your computer and use it in GitHub Desktop.
var middleware = function() { ... }
var stack = middleware(function(data1, data2, next) {
}, function(data1, data2, next) {
}, function(data1, data2, next) {
});
stack.handle(data1,data2);
// Use middleware as a flow control alternative to Step and async and others
Step(
function () {
// uses `this` instead of `next`
},
function () {
},
function () {
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment