| 491 | private idToClient = new Map<string, NormalizedHotChannelClient>() |
| 492 | |
| 493 | setupIfNeeded(client: NormalizedHotChannelClient, clientId: string) { |
| 494 | const id = this.clientToId.get(client) |
| 495 | if (id && id !== clientId) { |
| 496 | throw new Error( |
| 497 | 'client ID conflict detected. Please restart the dev server.', |
| 498 | ) |
| 499 | } |
| 500 | this.clientToId.set(client, clientId) |
| 501 | this.idToClient.set(clientId, client) |
| 502 | } |
| 503 | |
| 504 | get(id: string): NormalizedHotChannelClient | undefined { |
| 505 | return this.idToClient.get(id) |