Skip to content

Instantly share code, notes, and snippets.

@dminuoso
Last active November 7, 2017 18:45
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 dminuoso/94349ff4238382b8000c120b5d6c46f3 to your computer and use it in GitHub Desktop.
Save dminuoso/94349ff4238382b8000c120b5d6c46f3 to your computer and use it in GitHub Desktop.
const composeP2 = (f, g) => (val) => g(val).then((next) => f(next));
const composeP = (...funcs) => funcs.reverse().reduce(composeP2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment