Skip to content

Instantly share code, notes, and snippets.

@Maxim-Filimonov
Created August 23, 2015 07:26
Show Gist options
  • Save Maxim-Filimonov/29791a79dbadd100d972 to your computer and use it in GitHub Desktop.
Save Maxim-Filimonov/29791a79dbadd100d972 to your computer and use it in GitHub Desktop.
FP :::\
sum: R.reduce(this.add, 0),
totalVotes: R.compose(this.sum, R.drop(1))(?votes?),
calculatePercent: R.compose(R.curry(Math.round), R.multiply(100), R.divide(R.__, this.totalVotes)),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment