Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save serbiant/44dc913cbc0357d3139288fe14092145 to your computer and use it in GitHub Desktop.
Save serbiant/44dc913cbc0357d3139288fe14092145 to your computer and use it in GitHub Desktop.
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