Skip to content

Instantly share code, notes, and snippets.

@JamieDixon
Created July 21, 2018 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamieDixon/52647e494e572f9253e4fa49dfa63556 to your computer and use it in GitHub Desktop.
Save JamieDixon/52647e494e572f9253e4fa49dfa63556 to your computer and use it in GitHub Desktop.
const compose = (...fns) => function _compose(arg, funcs = [...fns], next = funcs.pop()) {
return funcs.length ? _compose(next(arg), funcs) : next(arg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment