Created
August 25, 2016 12:17
-
-
Save brunoskonrad/3767d3f473d3e9f8f86afb62a9e66506 to your computer and use it in GitHub Desktop.
This file contains 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
function chain(value) { | |
var currentValue = value | |
return { | |
pipe(func, ...params) { | |
const input = [currentValue, ...params] | |
currentValue = func.apply(null, input) | |
return this | |
}, | |
value() { | |
return currentValue | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment