Created
February 12, 2020 08:37
-
-
Save conanak99/992e9205d5f84d67061a8cee8a208363 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 io from 'socket.io-client'; | |
const socket = io('http://localhost:3002'); | |
socket.on('connect', () => { console.log('connected') }); | |
socket.on('newBet', function(newBet) { | |
const { id, name, avatar, bet, choice } = newBet; | |
const player = new Player(id, name, avatar); | |
store.dispatch('placeBet', { player, bet, choice }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment