Created
August 18, 2016 14:11
-
-
Save tuxsudo/1a1b31d9e29466df9e5418d8236d9dc9 to your computer and use it in GitHub Desktop.
Compose & Pipe
This file contains hidden or 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
| const compose = (...fns) => ( | |
| (x) => fns.reduceRight( (val, fn) => fn( val ), x ) | |
| ); | |
| export default compose; |
This file contains hidden or 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
| const pipe = (...fns) => ( | |
| (x) => fns.reduce( (val, fn) => fn( val ), x ) | |
| ); | |
| export default pipe; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment