import Server from 'socket.io';

export default function startServer(store) {
  const io = new Server().attach(8090);

  store.subscribe(
    () => {
      console.log('a change has occured in Store');

      io.emit('state', store.getState().toJS()
    })
  );
}

@@ -130,21 +130,16 @@
 bscribe(
-%0A    
 () =%3E %7B%0A
@@ -142,18 +142,16 @@
 %3E %7B%0A    
-  
 console.
@@ -193,18 +193,16 @@
 );%0A%0A    
-  
 io.emit(
@@ -240,15 +240,153 @@
 )%0A  
-  %7D)%0A  
+%7D));%0A%0A  io.on('connection', (socket) =%3E %7B%0A    console.log('a client has been connected');%0A%0A    socket.emit('state', store.getState().toJS());%0A  %7D
 );%0A%7D

send 'state' to a client on connection event