Created
May 2, 2016 19:46
-
-
Save Nepoxx/16751b68cb8b0009afda3f7dbc8f18cf 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
this.addNewListener = function(user) { | |
joinChannel(user.name); | |
return addNewChannelCache(user) | |
.then(function(data) { | |
return cache.getAsync(user.name); | |
}) | |
.then(function(obj) { | |
if (obj == null) { | |
throw new Exception('Object was not in cache'); | |
} else { | |
io.of('/' + user._id); | |
return obj; | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment