How to use socket.io-client.io:
GitHub: cocktailpeanut/dalai
458 459 460 461 462 463 464 465 466 467
} else { await this.query(req, cb) } } connect(req, cb) { const socket = io(req.url) socket.emit('request', req) socket.on('response', cb) socket.on('error', function(e) { throw e
376
0
53
See more examples
How to use socket.io-client.connect:
11 12 13 14 15 16 17 18 19 20
io : null, init:function(){ this.io = socket.connect(Config.socketUrl); this.io.on('socketerror', function(param){
357
606
69
See more examples