philomena/assets/js/cable.js

12 lines
330 B
JavaScript
Raw Permalink Normal View History

2019-10-05 02:09:52 +02:00
// Action Cable provides the framework to deal with WebSockets in Rails.
// You can generate new channels where WebSocket features live using the rails generate channel command.
let cable;
function setupCable() {
if (window.booru.userIsSignedIn) {
cable = ActionCable.createConsumer();
}
}
export { cable, setupCable };