Created
November 28, 2012 03:27
-
-
Save reinh/4158865 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
# Context: a campfire client using ranger (https://github.com/mrduncan/ranger) | |
# takes a callback function which it passes the messages returned from | |
# Campfire. | |
room.recentMessages (messages) -> console.log messages | |
# takes a user id and a callback function which it passes the user returned | |
# from Campfire. | |
client.user userId, (user) -> console.log user | |
# The problem is that I want to decorate each message with its associated user | |
# object. If client.user returned the user object directly I could do this: | |
for message in messages | |
message.user = client.user message.userId | |
# How do I do this via callbacks? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment