laravel-echo
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -385,5 +385,3 @@ var asyncGenerator = function () { | ||
_this.subscribe(); | ||
_this.socket.on('reconnect', function () { | ||
_this.subscribe(); | ||
}); | ||
_this.configureReconnector(); | ||
return _this; | ||
@@ -395,3 +393,3 @@ } | ||
value: function subscribe() { | ||
this.subscription = this.socket.emit('subscribe', { | ||
this.socket.emit('subscribe', { | ||
channel: this.name, | ||
@@ -430,2 +428,13 @@ auth: this.options.auth || {} | ||
}, { | ||
key: 'configureReconnector', | ||
value: function configureReconnector() { | ||
var _this3 = this; | ||
var listener = function listener() { | ||
_this3.subscribe(); | ||
}; | ||
this.socket.on('reconnect', listener); | ||
this.bind('reconnect', listener); | ||
} | ||
}, { | ||
key: 'bind', | ||
@@ -439,9 +448,9 @@ value: function bind(event, callback) { | ||
value: function unbind() { | ||
var _this3 = this; | ||
var _this4 = this; | ||
Object.keys(this.events).forEach(function (event) { | ||
_this3.events[event].forEach(function (callback) { | ||
_this3.subscription.removeListener(event, callback); | ||
_this4.events[event].forEach(function (callback) { | ||
_this4.socket.removeListener(event, callback); | ||
}); | ||
delete _this3.events[event]; | ||
delete _this4.events[event]; | ||
}); | ||
@@ -586,3 +595,3 @@ } | ||
value: function connect() { | ||
this.socket = io(this.options.host); | ||
this.socket = io(this.options.host, this.options); | ||
return this.socket; | ||
@@ -589,0 +598,0 @@ } |
{ | ||
"name": "laravel-echo", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Laravel Echo library for beautiful Pusher and Socket.IO integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/echo.js", |
128760
2952