import React, { Component } from 'react' let io = require('socket.io-client') class Server { constructor() { this.socket = null this.host = 'http://localhost' this.port = 5001 } connect = () => { return new Promise(resolve => { this.socket = io(this.host+':'+this.port) this.socket.on('connect', () => { resolve() }) }) } socket() { return this.socket } } export default Server