Skip to content

Instantly share code, notes, and snippets.

@dengjonathan
Last active November 21, 2016 20:48
Show Gist options
  • Save dengjonathan/e5f9f95d5086d8329534b9c21a5f8bfa to your computer and use it in GitHub Desktop.
Save dengjonathan/e5f9f95d5086d8329534b9c21a5f8bfa to your computer and use it in GitHub Desktop.
currying
//Ramda
const R = require('ramda');
const giveProp = (propName, prop, obj) => Object.assign({}, obj, {[propName]: prop});
const givePropCurry = R.curry(giveProp);
const giveName = givePropCurry('name');
const giveJob = givePropCurry(giveProp, 'job');
const giveHero = givePropCurry('hero');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment