This repository has been archived on 2020-10-16. You can view files and clone it, but cannot push or open issues or pull requests.
counter/frontend/client/cable.js

14 lines
232 B
JavaScript

import cable from "actioncable";
let consumer;
const createChannel = (...args) => {
if (!consumer) {
consumer = cable.createConsumer();
}
return consumer.subscriptions.create(...args);
};
export default createChannel;