Skip to content

Instantly share code, notes, and snippets.

@BrightnBubbly
Created April 9, 2020 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrightnBubbly/a82fb2a5613e39363432ea9cfdf0e0d5 to your computer and use it in GitHub Desktop.
Save BrightnBubbly/a82fb2a5613e39363432ea9cfdf0e0d5 to your computer and use it in GitHub Desktop.
// [...]
// 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