Created
April 2, 2014 16:05
-
-
Save amacdougall/9937183 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This works, but since it has to take `n, f1, ...` instead of `n, [f1, ...]`, | |
// we need to do a messy concat/apply at the end. | |
function pipeline(n) { | |
var actions = rest(arguments); | |
if (_.isEmpty(actions)) { | |
return n; | |
} else { | |
return pipeline.apply(null, [first(actions)(n)].concat(rest(actions))); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment