make it clear it's a method not a getter

Changed files
+3 -7
src
client
components
realm
+1 -3
src/client/components/peer-list.tsx
··· 10 10 11 11 useEffect(() => { 12 12 const updatePeers = () => { 13 - queueMicrotask(() => { 14 - setPeers(webrtcManager.peers) 15 - }) 13 + setPeers(webrtcManager.peerStates()) 16 14 } 17 15 18 16 // Listen to WebRTC events
+2 -4
src/client/realm/connection.ts
··· 51 51 this.#nonces = new Map() 52 52 53 53 console.debug('realm connection starting!') 54 + 54 55 this.#socket = new WebSocket(this.#url) 55 56 this.#socket.onopen = this.#handleSocketOpen 56 57 this.#socket.onclose = this.#handleSocketClose ··· 77 78 return this.#socket.readyState === this.#socket.OPEN 78 79 } 79 80 80 - get peers(): Record<IdentID, PeerState> { 81 + peerStates(): Record<IdentID, PeerState> { 81 82 const states: Record<IdentID, PeerState> = {} 82 83 for (const [identid, peer] of this.#peers) { 83 84 states[identid] = { ··· 113 114 114 115 destroy() { 115 116 console.debug('realm connection destroy!') 116 - 117 - // disconnect from socket 118 117 if (this.connected) { 119 118 this.#socket.close() 120 119 } ··· 158 157 159 158 // handle socket open is the main loop for the sendSocket 160 159 #handleSocketOpen: WebSocket['onopen'] = async () => { 161 - console.debug('realm connection, socket loop open') 162 160 this.#dispatchCustomEvent('wsopen') 163 161 164 162 try {