(function () { let instance; function createInstance() { const io = require('socket.io-client') const socket = io.connect(); return socket; } return { getInstance: function () { if (!instance) { instance = createInstance(); } return instance; } }; })()