renamed encoder variable #9

This commit is contained in:
Kevin Jahns 2020-04-07 14:04:27 +02:00
parent 848976efe3
commit 08d164dc26

View file

@ -352,10 +352,10 @@ export class Room {
*/ */
this._awarenessUpdateHandler = ({ added, updated, removed }, origin) => { this._awarenessUpdateHandler = ({ added, updated, removed }, origin) => {
const changedClients = added.concat(updated).concat(removed) const changedClients = added.concat(updated).concat(removed)
const encoder = encoding.createEncoder() const encoderAwareness = encoding.createEncoder()
encoding.writeVarUint(encoder, messageAwareness) encoding.writeVarUint(encoderAwareness, messageAwareness)
encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(this.awareness, changedClients)) encoding.writeVarUint8Array(encoderAwareness, awarenessProtocol.encodeAwarenessUpdate(this.awareness, changedClients))
broadcastRoomMessage(this, encoding.toUint8Array(encoder)) broadcastRoomMessage(this, encoding.toUint8Array(encoderAwareness))
} }
this.doc.on('update', this._docUpdateHandler) this.doc.on('update', this._docUpdateHandler)
this.awareness.on('change', this._awarenessUpdateHandler) this.awareness.on('change', this._awarenessUpdateHandler)