Created
May 17, 2016 04:27
-
-
Save prathamesh-sonpatki/97e1718f806b92441e66cd8bb2897e14 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
App.chat = App.cable.subscriptions.create "ChatChannel", | |
connected: -> | |
# Called when the subscription is ready for use on the server | |
disconnected: -> | |
# Called when the subscription has been terminated by the server | |
received: (data) -> | |
# Called when there's incoming data on the websocket for this channel | |
speak: -> | |
@perform 'speak' |
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
(function() { | |
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'); | |
} | |
}); | |
}).call(this) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment