Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.socket.onmessage = (messageEvent) => {
try {
const websocketResponse = WebsocketResponse.deserialize(messageEvent.data)
this.emit(websocketResponse.constructor.getMessageName(), websocketResponse)
} catch (err) {
this.emit('error', err)
}
}