Current section
Files
Jump to
Current section
Files
examples/phoenix_adk_ui/assets/js/app.js
import "phoenix_html"
import {Socket} from "phoenix"
import {LiveSocket} from "phoenix_live_view"
import {LiveVoice} from "./live_voice"
const csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
const liveSocket = new LiveSocket("/live", Socket, {
longPollFallbackMs: 2500,
params: {_csrf_token: csrfToken},
hooks: {LiveVoice},
})
liveSocket.connect()
window.liveSocket = liveSocket