Skip to content

Instantly share code, notes, and snippets.

@alexandrebodin
Created September 7, 2016 07:05
Show Gist options
  • Save alexandrebodin/3128f9636045f439deb0c04192852ba9 to your computer and use it in GitHub Desktop.
Save alexandrebodin/3128f9636045f439deb0c04192852ba9 to your computer and use it in GitHub Desktop.
const phoneToString = phone => `${phone.prefix} ${phone.number}`;
const phones = [
{
prefix: '+33',
number: '102219123',
},
{
prefix: '+33',
number: '1111111111',
},
];
const contact = {
coordinates: {
phones,
},
};
R.pipe(
R.pathOr([], ['coordinates', 'phones']),
R.map(phoneToString),
R.join(' / ')
)
(contact);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment