Skip to content

Instantly share code, notes, and snippets.

@brunoskonrad
Created August 25, 2016 12:17
Show Gist options
  • Save brunoskonrad/3767d3f473d3e9f8f86afb62a9e66506 to your computer and use it in GitHub Desktop.
Save brunoskonrad/3767d3f473d3e9f8f86afb62a9e66506 to your computer and use it in GitHub Desktop.
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