Skip to content

Instantly share code, notes, and snippets.

@luijar
Created September 26, 2015 21:38
Show Gist options
  • Save luijar/3f0f4db77fc8ab3492ea to your computer and use it in GitHub Desktop.
Save luijar/3f0f4db77fc8ab3492ea to your computer and use it in GitHub Desktop.
Mapping lenses over a collection of objects
// Collection of person objects
var people = [
ana, luis, carlos, nestor, maria
];
var firstnames =
R.compose(
R.map(R.view(firstnameLens)),
R.map(R.over(firstnameLens, R.toUpper)));
firstnames(people);//-> ["ANA", "LUIS", "CARLOS", "NESTOR", "MARIA"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment