mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
Support for multiple data arguments + acks
This commit is contained in:
parent
8951667903
commit
86cf519185
1 changed files with 7 additions and 2 deletions
|
@ -22,7 +22,12 @@ export default class{
|
||||||
this.Socket.onevent = (packet) => {
|
this.Socket.onevent = (packet) => {
|
||||||
super_onevent.call(this.Socket, packet);
|
super_onevent.call(this.Socket, packet);
|
||||||
|
|
||||||
Emitter.emit(packet.data[0], packet.data[1]);
|
let args = [...packet.data]
|
||||||
|
|
||||||
|
if(packet.id !== null)
|
||||||
|
args.push(this.Socket.ack(packet.id))
|
||||||
|
|
||||||
|
Emitter.emit.apply(Emitter, args)
|
||||||
|
|
||||||
if(this.store) this.passToStore('SOCKET_'+packet.data[0], [ ...packet.data.slice(1)])
|
if(this.store) this.passToStore('SOCKET_'+packet.data[0], [ ...packet.data.slice(1)])
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue