Last active
August 29, 2015 14:13
-
-
Save Tombert/76e02869e2fa4802fada to your computer and use it in GitHub Desktop.
Showing Rex how I'd do it
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
getUserObjectSomehow = () -> | |
id: 5 | |
logged_in:true | |
do_something = (user) -> "> Logged in user #{user.id}: #{JSON.stringify(user, null, 4)}" unless !user.logged_in | |
# Admittedly this is mildly dependent on underscore or lodash. | |
log = console.log.bind(window) | |
printSomething = _.compose console.log, do_something | |
user = do getUserObjectSomehow | |
printSomething user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment