-
-
Save BrightnBubbly/a82fb2a5613e39363432ea9cfdf0e0d5 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
// [...] | |
// fetch the channel state, subscribe to future updates | |
channel.watch().then(state => { | |
this.messages = state.messages | |
// Listen for new messages on the channel | |
channel.on('message.new', event => { | |
this.messages.push(event.message) | |
}); | |
}) | |
// [...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment