MCPcopy
hub / github.com/MetinSeylan/Vue-Socket.io / connect

Method connect

src/index.js:45–65  ·  view source on GitHub ↗

* registering SocketIO instance * @param connection * @param options

(connection, options)

Source from the content-addressed store, hash-verified

43 * @param options
44 */
45 connect(connection, options){
46
47 if(connection && typeof connection === 'object'){
48
49 Logger.info('Received socket.io-client instance');
50
51 return connection;
52
53 } else if(typeof connection === 'string'){
54
55 Logger.info('Received connection string');
56
57 return this.io = SocketIO(connection, options);
58
59 } else {
60
61 throw new Error('Unsupported connection type');
62
63 }
64
65 }
66
67}

Callers 1

constructorMethod · 0.95

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected