Last active
August 10, 2018 19:41
-
-
Save migerh/523d5f0901188ef7e222c7e06282f180 to your computer and use it in GitHub Desktop.
ramda.js forked processing
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 person = { | |
first: "Nikola", | |
last: "Testa" | |
}; | |
const getFirstName = prop('first'); | |
const getLastName = prop('last'); | |
const whitespace = () => ' '; | |
const concatenateMultipleStrings = unapply(reduce(concat, '')) | |
const getFullName = converge(concatenateMultipleStrings, [getFirstName, whitespace, getLastName]); | |
getFullName(person); |
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 person = { | |
first: "Nikola", | |
last: "Testa" | |
}; | |
const getFullName = person => `${person.first} ${person.last}`; | |
getFullName(person); |
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 person = { | |
first: "Nikola", | |
last: "Testa" | |
}; | |
const getFirstName = prop('first'); | |
const getLastName = prop('last'); | |
const getNames = unapply(ap([getFirstName, getLastName])); | |
const getFullName = pipe( | |
getNames, | |
insert(1, ' '), | |
reduce(concat, '') | |
); | |
getFullName(person); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment