Skip to content

Instantly share code, notes, and snippets.

@MicroBenz
Last active December 3, 2017 15:43
Show Gist options
  • Save MicroBenz/56bc508a880508bbab20f17565b0947b to your computer and use it in GitHub Desktop.
Save MicroBenz/56bc508a880508bbab20f17565b0947b to your computer and use it in GitHub Desktop.
Recompose
const addBy = a => b => a + b; // addBy is function that take "a" as an argument and return a function b => a + b
const addByFive = addBy(5); // It will return b => 5 + b And it is a function!
const addByTen = addBy(10); // It will return b => 10 + b And it is a function!
addByFive(7); // 12
addByTen(59); // 69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment