Skip to content

Instantly share code, notes, and snippets.

@joeynimu
Created April 23, 2019 12:13
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 joeynimu/0fb03d1e29c871af8875db51dd5fc56c to your computer and use it in GitHub Desktop.
Save joeynimu/0fb03d1e29c871af8875db51dd5fc56c to your computer and use it in GitHub Desktop.
JS Utility Functions
// a function that composes any number of functions
const compose = (..fns) => x => fns.reduceRight((acc, fn) => fn(acc), x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment