Args won't always be present
This commit is contained in:
parent
030b8ed4fd
commit
b78276d23d
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ export class Websocket extends EventEmitter {
|
|||
onmessage: e => {
|
||||
try {
|
||||
let { event, args } = JSON.parse(e.data);
|
||||
this.emit(event, ...args);
|
||||
args ? this.emit(event, ...args) : this.emit(event);
|
||||
} catch (ex) {
|
||||
console.warn('Failed to parse incoming websocket message.', ex);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue