Created
May 2, 2016 19:46
-
-
Save Nepoxx/16751b68cb8b0009afda3f7dbc8f18cf to your computer and use it in GitHub Desktop.
Revisions
-
Nepoxx created this gist
May 2, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ 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; } }); }