ngscheurich/fresh-pots

View on GitHub
app/frontend/js/cable.js

Summary

Maintainability
A
0 mins
Test Coverage
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");
  }
}