Skip to content

Instantly share code, notes, and snippets.

@sethdorris
Last active May 3, 2016 21:49
Show Gist options
  • Save sethdorris/b85d0bf47da1f11c9b0d851465a402c3 to your computer and use it in GitHub Desktop.
Save sethdorris/b85d0bf47da1f11c9b0d851465a402c3 to your computer and use it in GitHub Desktop.
Passing WebSocket Instance
export default const server = {
server: null,
getServer: return this.server,
create: () => {
const server = new WebSocket("ws://localhost:3000");
this.server = server
},
sendmessage: () => {
return server.onmessage = ()=> {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment