Last active
December 5, 2021 14:24
-
-
Save neftaly/6e11268f1cd230094c81 to your computer and use it in GitHub Desktop.
ES6 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 compose = (...args) => initial => args.reduceRight( | |
| (result, fn) => fn(result), | |
| initial | |
| ); |
Hello, here's my version https://gist.github.com/WaldoJeffers/905e14d03f4283599bac753f73b7716b. Does it cover your use cases ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@iamstarkov How does the functions handle functions with two arguments? Could you give me an example or how to modify the code so it handles them?