Created
March 28, 2015 22:34
-
-
Save Rulexec/de4285992d7dc2de25ec 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
function showLobby(session) { | |
var lobby = new LobbyClient({session: session}); | |
var lobbyUi = new LobbyUi({element: rootElement}); | |
var processLobbyEventsUntilNotJoinRoom = lobbyUi.poll().bind(function(event) { | |
if (event.type === LobbyUi.EVENTS.JOIN_ROOM) { | |
this.cont(null, event.id); | |
} else { | |
return processLobbyEventsUntilNotJoinRoom; | |
} | |
}); | |
return lobby.getAllRooms().bind(lobbyUi.rooms | |
).skip(lobbyUi.start()).skip(processLobbyEventsUntilNotJoinRoom); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment