socketio fixed

This commit is contained in:
2017-03-13 13:53:22 +01:00
parent 961ab22a78
commit f727401af0
3 changed files with 21 additions and 4 deletions

View File

@ -1,6 +1,4 @@
'use strict';
//import io from('/socket.io/socket.io.js');
let io = require('socket.io-client')
let iosocket = io.connect();
// setup all my handlers
@ -8,6 +6,11 @@ iosocket.on('clientrefresh', () => {
location.reload();
});
iosocket.on('stateChange', () => {
location.reload();
});
// get my state
let context = 'main';
iosocket.emit('loadState',context);