Add remove event listener methods

This commit is contained in:
Andras Schmelczer 2025-11-22 20:35:36 +00:00
parent 8135bc0e27
commit c02e59034d
6 changed files with 54 additions and 0 deletions

View file

@ -74,6 +74,15 @@ export class WebSocketManager {
this.remoteCursorsUpdateListeners.push(listener);
}
public removeRemoteCursorsUpdateListener(
listener: (cursors: ClientCursors[]) => unknown
): void {
const index = this.remoteCursorsUpdateListeners.indexOf(listener);
if (index !== -1) {
this.remoteCursorsUpdateListeners.splice(index, 1);
}
}
public start(): void {
this.isStopped = false;
this._isFirstSyncCompleted = false;