-
-
Save shankardevy/99481668c30c4bf5603fc4f19fa89386 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Socket} from "phoenix" | |
let socket = new Socket("/socket", {params: {token: window.userToken}}) | |
socket.connect() | |
let channel = socket.channel("pos", {}) | |
channel.join() | |
.receive("ok", resp => { | |
console.log("Joined successfully", resp) | |
$("#intro-text").text(resp.message) | |
}) | |
.receive("error", resp => { console.log("Unable to join", resp) }) | |
export default socket |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment