Merge pull request #67 from ncoden/fix/event-inheritance

Fix: propagate event to Socket
This commit is contained in:
Metin Seylan 2017-08-15 07:43:47 +03:00 committed by GitHub
commit d3c8d11f9e

View file

@ -18,7 +18,10 @@ export default class{
}
onEvent(){
var super_onevent = this.Socket.onevent;
this.Socket.onevent = (packet) => {
super_onevent.call(this.Socket, packet);
Emitter.emit(packet.data[0], packet.data[1]);
if(this.store) this.passToStore('SOCKET_'+packet.data[0], [ ...packet.data.slice(1)])