Skip to content

Commit 2b64d78

Browse files
author
Travis CI
committed
Travis CI - [ci skip] - automatic dist folder
1 parent d90795e commit 2b64d78

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

dist/kuzzle.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@
250250
},{}],2:[function(require,module,exports){
251251
var
252252
uuid = require('node-uuid'),
253-
io = require('socket.io-client'),
254253
KuzzleDataCollection = require('./kuzzleDataCollection');
255254

256255
/**
@@ -298,6 +297,10 @@ module.exports = Kuzzle = function (url, options, cb) {
298297
reconnected: []
299298
}
300299
},
300+
io: {
301+
value: null,
302+
writable: true
303+
},
301304
queuing: {
302305
value: false,
303306
writable: true
@@ -408,6 +411,12 @@ module.exports = Kuzzle = function (url, options, cb) {
408411
}
409412
});
410413

414+
if (typeof window !== 'undefined' && window.io) {
415+
this.io = window.io;
416+
} else {
417+
this.io = require('socket.io-client');
418+
}
419+
411420
if (options) {
412421
Object.keys(options).forEach(function (opt) {
413422
if (self.hasOwnProperty(opt) && Object.getOwnPropertyDescriptor(self, opt).writable) {
@@ -493,7 +502,7 @@ Kuzzle.prototype.connect = function (cb) {
493502

494503
self.state = 'connecting';
495504

496-
self.socket = io(self.url, {
505+
self.socket = self.io(self.url, {
497506
reconnection: self.autoReconnect,
498507
reconnectionDelay: self.reconnectionDelay,
499508
'force new connection': true

0 commit comments

Comments
 (0)