Skip to content

Instantly share code, notes, and snippets.

@ndabAP
Last active January 14, 2018 08:50
Show Gist options
  • Save ndabAP/973593ae9d075f3de2745518a68dd2fd to your computer and use it in GitHub Desktop.
Save ndabAP/973593ae9d075f3de2745518a68dd2fd to your computer and use it in GitHub Desktop.
How to use Lodash's functional programs functions within a regular pattern
/**
* This way, you can import the functional program function and use in two ways. You don't have to fear any name collisions.
*/
let element = [{key: 1, value: a}, {key: 2, value: b}]
// Functional program usage
flow([
map(element => omit(['key']))
])(elements)
let first = head(element)
// Regular usage
omit(['key'])(first)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment