Created
June 3, 2017 20:39
-
-
Save BnayaZil/30465de449780199e33da9b3dde82303 to your computer and use it in GitHub Desktop.
Ramda series
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
import {prop, compose} from 'ramda' | |
const player = { | |
id: 1, | |
name: 'Bnaya', | |
file: { | |
img: 'http://foo.bar/bnaya-zil.png', | |
thumb: 'http://foo.bar/bnaya-zil-thumb.png' | |
} | |
} | |
const getFile = prop('file') | |
const getThumb = prop('thumb') | |
const getPlayerPicture = compose(getThumb, getFile) | |
const playerPicture = getPlayerPicture(player) // returns: 'http://foo.bar/bnaya-zil-thumb.png' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment