app/frontend/js/cable.js
import React from "react";
import ActionCable from "actioncable";
import { component } from "./render";
import RecentBrews from "./components/RecentBrews";
export function brews() {
if (location.pathname === "/dashboard") {
const cable = ActionCable.createConsumer(`wss://${location.host}/cable`);
component(<RecentBrews cable={cable} />, "brew-list");
}
}