Skip to content

Instantly share code, notes, and snippets.

@ataube
Created February 4, 2017 12:19
Show Gist options
  • Save ataube/aa48b245715a62a52243f48dc9403c19 to your computer and use it in GitHub Desktop.
Save ataube/aa48b245715a62a52243f48dc9403c19 to your computer and use it in GitHub Desktop.
ES6 based function composition
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment