Skip to content

Instantly share code, notes, and snippets.

@Raynos
Last active December 15, 2015 04:19
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 Raynos/c8d64ae2be96abf0bd21 to your computer and use it in GitHub Desktop.
Save Raynos/c8d64ae2be96abf0bd21 to your computer and use it in GitHub Desktop.
// writing a function that does effectively _.pluck is a pain
// I don't like the function return noise
var isOnline = map(status, function (x) { return x.online })
// one alternative is to use a function prop, which is higher
// order and returns a function that returns that property
var isOnline = map(status, prop("online"))
// another option is making it easier to write single
// expression functions. Thus avoiding the need for a bunch
// of higher order functions like https://github.com/gozala/oops
var isOnline = map(status, λ("x.online"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment