Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
App.chat = App.cable.subscriptions.create("ChatChannel", {
connected: function() {
// Called when the subscription is ready for use on the server
},
disconnected: function() {
// Called when the subscription has been terminated by the server
},
received: function(data) {
// Called when there's incoming data on the websocket for this channel
},
speak: function() {
return this.perform('speak');
},
mute: function() {
return this.perform('mute');
},
broadcast: function() {
return this.perform('broadcast');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.