Last active
May 23, 2018 11:31
-
-
Save hugomd/878ee0de00ca6ca2a67cfa1a3a318192 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
... | |
const room = availableRooms[chosenRoom] | |
+ await currentUser.subscribeToRoom({ | |
+ roomId: room.id, | |
+ hooks: { | |
+ onNewMessage: message => { | |
+ const { senderId, text } = message | |
+ if (senderId === username) return | |
+ console.log(`${senderId}: ${text}`) | |
+ } | |
+ }, | |
+ messageLimit: 0 | |
+ }) | |
+ console.log(`Joined ${room.name} successfully`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment