Created
July 8, 2019 16:32
-
-
Save dongido001/cdb62604592b0842879e7654d827d5e7 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