Created
August 2, 2011 13:09
-
-
Save rich97/1120138 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// I don't like this: | |
/* | |
socket.on('answer', function(answer, fn) { | |
socket.get('game', function(ge, g) { | |
socket.get('score', function(se, score) { | |
*/ | |
// this is much nicer, I could even make a function to keep it DRY | |
var test; | |
socket.get('socket_var', function(err, socket_variable) { | |
test = socket_variable; | |
}); | |
console.log(test); | |
// Hi! I'm a socket variable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment