Skip to content

Instantly share code, notes, and snippets.

@ericcornelissen
ericcornelissen / function-pipeline-creator.js
Last active May 15, 2019 23:33
Functional JavaScript: simple function pipeline creators
let pipe = function() {
let functions = arguments,
intermediate = undefined;
return function() {
intermediate = functions[0].apply(this, arguments);
for(let i = 1; i < functions.length; i++) {
intermediate = functions[i](intermediate);
}