Mix.install([:tesla, :jason, :kino])
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,LongPoll} from "./socket.js" | |
let socket = new Socket("/socket", { location: "localhost:4000", transport: LongPoll, params: {token: "asdf"}}) | |
socket.connect() | |
socket.onClose( e => console.log("Closed connection") ) | |
var channel = socket.channel("atv:lobby", {}) | |
channel.join() | |
.receive("ok", resp => { console.log("Joined successfully", resp) }) | |
.receive( "error", () => console.log("Connection error") ) |
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 longPoll from './lib/longPoll'; | |
longPoll("http://example.com/livereload", (err,res) => { | |
if(err){ | |
console.log("error"); | |
console.log(err); | |
} else { | |
console.log("reloading"); | |
console.log(res); | |
} | |
}); |