feat: add backpex (config, js hooks, deps, css, formatter)

This commit is contained in:
Moritz 2025-07-03 13:56:50 +02:00
parent b05cd7db77
commit 5d0e8b5f78
Signed by: moritz
GPG key ID: 1020A035E5DD0824
6 changed files with 31 additions and 12 deletions

View file

@ -20,12 +20,14 @@ import "phoenix_html"
// Establish Phoenix Socket and LiveView configuration.
import {Socket} from "phoenix"
import {LiveSocket} from "phoenix_live_view"
import { Hooks as BackpexHooks } from 'backpex'
import topbar from "../vendor/topbar"
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
let liveSocket = new LiveSocket("/live", Socket, {
longPollFallbackMs: 2500,
params: {_csrf_token: csrfToken}
params: {_csrf_token: csrfToken},
hooks: {...BackpexHooks}
})
// Show progress bar on live navigation and form submits