Last active
November 21, 2016 20:48
-
-
Save dengjonathan/e5f9f95d5086d8329534b9c21a5f8bfa to your computer and use it in GitHub Desktop.
currying
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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