Skip to content

Instantly share code, notes, and snippets.

@migerh
Last active August 10, 2018 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save migerh/523d5f0901188ef7e222c7e06282f180 to your computer and use it in GitHub Desktop.
Save migerh/523d5f0901188ef7e222c7e06282f180 to your computer and use it in GitHub Desktop.
ramda.js forked processing
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);
const person = {
first: "Nikola",
last: "Testa"
};
const getFullName = person => `${person.first} ${person.last}`;
getFullName(person);
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