Created
August 17, 2017 17:45
-
-
Save serbiant/44dc913cbc0357d3139288fe14092145 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
console.log('here we go!'); | |
var App = {}; | |
var client = 'r-fNxy-djik7RS--qCOxbQ', | |
access_token = 'dYGeW4UHUlAuiBP8sASs8w', | |
uid = '%2B79885647988'; | |
App.cable = ActionCable.createConsumer('/cable?access-token=' + access_token + '&client='+ client +'&uid=' + uid); | |
App.room = App.cable.subscriptions.create({ | |
channel: "TrainingChannel", | |
training_id: 1}, { | |
connected: function() { | |
console.log('connected'); | |
}, | |
disconnected: function() {}, | |
received: function(data) { | |
console.log(data['message']); | |
}, | |
speak: function(message) { | |
return this.perform('speak', { | |
message: message | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment