Skip to content

Commit 0f0f98b

Browse files
committed
Format JavaScript
1 parent 84f3aea commit 0f0f98b

File tree

1 file changed

+15
-12
lines changed
  • apps/components_guide_web/assets/js

1 file changed

+15
-12
lines changed

apps/components_guide_web/assets/js/app.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// We need to import the CSS so that webpack will load it.
22
// The MiniCssExtractPlugin is used to separate it out into
33
// its own CSS file.
4-
import css from "../css/app.css"
4+
import css from "../css/app.css";
55

66
// webpack automatically bundles all modules in your
77
// entry points. Those entry points can be configured
@@ -10,25 +10,28 @@ import css from "../css/app.css"
1010
// Import dependencies
1111
//
1212
import "phoenix_html";
13-
import {Socket} from "phoenix"
14-
import NProgress from "nprogress"
15-
import LiveSocket from "phoenix_live_view"
16-
17-
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
18-
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
13+
import { Socket } from "phoenix";
14+
import NProgress from "nprogress";
15+
import LiveSocket from "phoenix_live_view";
16+
17+
let csrfToken = document
18+
.querySelector("meta[name='csrf-token']")
19+
.getAttribute("content");
20+
let liveSocket = new LiveSocket("/live", Socket, {
21+
params: { _csrf_token: csrfToken }
22+
});
1923

2024
// Show progress bar on live navigation and form submits
21-
window.addEventListener("phx:page-loading-start", info => NProgress.start())
22-
window.addEventListener("phx:page-loading-stop", info => NProgress.done())
25+
window.addEventListener("phx:page-loading-start", info => NProgress.start());
26+
window.addEventListener("phx:page-loading-stop", info => NProgress.done());
2327

2428
// connect if there are any LiveViews on the page
25-
liveSocket.connect()
29+
liveSocket.connect();
2630

2731
// expose liveSocket on window for web console debug logs and latency simulation:
2832
// >> liveSocket.enableDebug()
2933
// >> liveSocket.enableLatencySim(1000)
30-
window.liveSocket = liveSocket
31-
34+
window.liveSocket = liveSocket;
3235

3336
import Vue from "vue";
3437
import VueEditor from "./editor.vue";

0 commit comments

Comments
 (0)