| // Action Cable provides the framework to deal with WebSockets in Rails. | <> | // Load all the channels within this directory and all subdirectories. |
| // You can generate new channels where WebSocket features live using the `rails generate channel` command. | ||
| // | ||
| //= require action_cable | ||
| //= require_self | ||
| //= require_tree ./channels | ||
| // Channel files must be named *_channel.js. | ||
| (function() { | ||
| this.App || (this.App = {}); | ||
| const channels = require.context('.', true, /_channel\.js$/) | ||
| App.cable = ActionCable.createConsumer(); | ||
| channels.keys().forEach(channels) | ||
| }).call(this); |