How to use phoenix_live_view - 1 common examples

To help you get started, we’ve selected a few phoenix_live_view examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github moomerman / flappy-phoenix / assets / js / app.js View on Github external
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
// in "webpack.config.js".
//
// Import dependencies
//
import "phoenix_html"

// Import local files
//
// Local files can be imported directly using relative paths, for example:
// import socket from "./socket"

import { Socket } from "phoenix"
import LiveSocket from "phoenix_live_view"
let liveSocket = new LiveSocket("/live", Socket)
liveSocket.connect()

document.addEventListener("touchstart", flap, true);
document.addEventListener("click", flap, true);
function flap() {
  window.dispatchEvent(new KeyboardEvent('keydown', { 'key': 'f' }));
}

phoenix_live_view

The Phoenix LiveView JavaScript client.

MIT
Latest version published 8 days ago

Package Health Score

87 / 100
Full package analysis

Popular phoenix_live_view functions

Similar packages