Packages

Elixir/Phoenix admin framework for resources, dashboards, datasets, actions, authorization, and service-owned remote admin surfaces.

Current section

Files

Jump to
incant assets js app.ts
Raw

assets/js/app.ts

import { Socket } from "phoenix";
import { LiveSocket } from "phoenix_live_view";
import { mountIncant } from "./incant";
const csrfToken = document.querySelector<HTMLMetaElement>("meta[name='csrf-token']")?.content;
const liveSocket = new LiveSocket("/live", Socket, {
longPollFallbackMs: 2500,
params: { _csrf_token: csrfToken },
});
mountIncant();
liveSocket.connect();
window.liveSocket = liveSocket;