-
-
Save Raynos/c8d64ae2be96abf0bd21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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