Skip to content

Instantly share code, notes, and snippets.

@alekstar79
Created October 16, 2023 16:02
Show Gist options
  • Save alekstar79/1dfd447d5314e09a0ad0d8dd459cf83c to your computer and use it in GitHub Desktop.
Save alekstar79/1dfd447d5314e09a0ad0d8dd459cf83c to your computer and use it in GitHub Desktop.
function pipe(...fn) {
return function piped(...args) {
return fn.reduce((result, f) => [f.call(this, ...result)], args)[0]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment