Created
August 2, 2017 20:41
-
-
Save gdekefir/fc74b086052c3d2fc73c98f79e3a1f6c to your computer and use it in GitHub Desktop.
Getting prop value via ramda and fantasy-birds
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
//const fn = obj => key => key => propOr(key, key, obj); | |
const fn = warblerstar(robinstar(propOr)); | |
const src = { | |
some: 22, | |
other: 33 | |
}; | |
fn(src, 'some'); //-> 22 | |
fn(src, 'qqq'); //-> 'qqq' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment