Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Add placeholder for LiveView hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dbernheisel committed Feb 28, 2021
1 parent 71117e9 commit 5209134
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 17,11 @@ import {Socket} from "phoenix"
import {LiveSocket} from "phoenix_live_view"
import "alpinejs"
import "./loading-bar"
import hooks from "./liveview-hooks"

let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
let liveSocket = new LiveSocket("/live", Socket, {
hooks,
params: {_csrf_token: csrfToken},
dom: {
onBeforeElUpdated(from, to){
Expand Down
2 changes: 2 additions & 0 deletions assets/js/liveview-hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 1,2 @@
let hooks = {}
export default hooks

0 comments on commit 5209134

Please sign in to comment.