Created
November 7, 2018 12:35
-
-
Save chee/ac0383904900f7b1926f84ee3148e4d7 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
export default (...functions) => (...args) => | |
functions | |
.slice(0, -1) | |
.reduceRight( | |
(result, fn) => fn(result), | |
functions[functions.length - 1](...args) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment