Skip to content

Instantly share code, notes, and snippets.

@ncuillery
Last active May 23, 2017 13:25
Show Gist options
  • Save ncuillery/b0f801a57d477c358aecbb5dc29efb6d to your computer and use it in GitHub Desktop.
Save ncuillery/b0f801a57d477c358aecbb5dc29efb6d to your computer and use it in GitHub Desktop.
ReactEurope2017_3
const names = compose(
map(person => person.name),
sortBy(person => person.age),
filter(person => person.age < 30)
)(persons);
// In opposite to lodash/fp/compose, lodash/fp/pipe preserves the chain order:
const names = pipe(
filter(person => person.age < 30),
sortBy(person => person.age),
map(person => person.name)
)(persons);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment