Created
February 26, 2018 01:52
-
-
Save JaeYeopHan/d2fc84e202852811daaf8da3106613d7 to your computer and use it in GitHub Desktop.
JavaScript functions - pipe
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
export function pipe(...fns) { | |
return param => fns.reduce( | |
(result, fn) => fn(result), | |
param | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment