embed parsed packet in console

This commit is contained in:
slice 2018-07-18 12:27:52 -07:00
parent 7f6e946c2b
commit e8f8d89aa8
No known key found for this signature in database
GPG Key ID: 1508C19D7436A26D
1 changed files with 2 additions and 2 deletions

View File

@ -72,15 +72,15 @@ export default class StreamingClient extends NanoEvents {
}
ws.onmessage = ({ data }) => {
log(`recv: ${data}`)
const packet = JSON.parse(data)
log('recv:', packet)
this.emit('packet', packet)
this.handle(packet)
}
ws.onerror = (err) => {
log(`error: ${err}`)
log('error:', err)
}
}
}