mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-27 04:32:42 +00:00
Live timelines using ActionCable
This commit is contained in:
parent
10ba09f546
commit
6deb9f966e
24 changed files with 99 additions and 53 deletions
13
app/assets/javascripts/channels/timeline.js
Normal file
13
app/assets/javascripts/channels/timeline.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
App.timeline = App.cable.subscriptions.create("TimelineChannel", {
|
||||
connected: function() {
|
||||
console.log('Connected');
|
||||
},
|
||||
|
||||
disconnected: function() {
|
||||
console.log('Disconnected');
|
||||
},
|
||||
|
||||
received: function(data) {
|
||||
console.log(JSON.parse(data.message));
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue