laravel-echo
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -250,8 +250,6 @@ var asyncGenerator = function () { | ||
value: function format(event) { | ||
if (this.namespace) { | ||
if (event.charAt(0) != '\\' && event.charAt(0) != '.') { | ||
event = this.namespace + '.' + event; | ||
} else { | ||
event = event.substr(1); | ||
} | ||
if (event.charAt(0) === '.' || event.charAt(0) === '\\') { | ||
return event.substr(1); | ||
} else if (this.namespace) { | ||
event = this.namespace + '.' + event; | ||
} | ||
@@ -596,2 +594,7 @@ return event.replace(/\./g, '\\'); | ||
} | ||
}, { | ||
key: 'disconnect', | ||
value: function disconnect() { | ||
this.pusher.disconnect(); | ||
} | ||
}]); | ||
@@ -672,2 +675,7 @@ return PusherConnector; | ||
} | ||
}, { | ||
key: 'disconnect', | ||
value: function disconnect() { | ||
this.socket.disconnect(); | ||
} | ||
}]); | ||
@@ -767,2 +775,7 @@ return SocketIoConnector; | ||
} | ||
}, { | ||
key: 'disconnect', | ||
value: function disconnect() { | ||
this.connector.disconnect(); | ||
} | ||
}]); | ||
@@ -769,0 +782,0 @@ return Echo; |
{ | ||
"name": "laravel-echo", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Laravel Echo library for beautiful Pusher and Socket.IO integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/echo.js", |
@@ -120,2 +120,9 @@ import { Channel, PresenceChannel } from './../channel'; | ||
abstract socketId(): string; | ||
/** | ||
* Disconnect from the Echo server. | ||
* | ||
* @return void | ||
*/ | ||
abstract disconnect(): void; | ||
} |
@@ -124,2 +124,11 @@ import { Connector} from './connector'; | ||
} | ||
/** | ||
* Disconnect Pusher connection. | ||
* | ||
* @return void | ||
*/ | ||
disconnect(): void { | ||
this.pusher.disconnect(); | ||
} | ||
} |
@@ -125,2 +125,11 @@ import { Connector } from './connector'; | ||
} | ||
/** | ||
* Disconnect Socketio connection. | ||
* | ||
* @return void | ||
*/ | ||
disconnect(): void { | ||
this.socket.disconnect(); | ||
} | ||
} |
@@ -146,4 +146,13 @@ import { EventFormatter } from './util'; | ||
} | ||
/** | ||
* Disconnect from the Echo server. | ||
* | ||
* @return void | ||
*/ | ||
disconnect(): void { | ||
this.connector.disconnect(); | ||
} | ||
} | ||
module.exports = Echo; |
@@ -29,8 +29,6 @@ /** | ||
format(event: string): string { | ||
if (this.namespace) { | ||
if (event.charAt(0) != '\\' && event.charAt(0) != '.') { | ||
event = this.namespace + '.' + event; | ||
} else { | ||
event = event.substr(1); | ||
} | ||
if (event.charAt(0) === '.' || event.charAt(0) === '\\') { | ||
return event.substr(1); | ||
} else if (this.namespace) { | ||
event = this.namespace + '.' + event; | ||
} | ||
@@ -37,0 +35,0 @@ |
155588
3957