This removes the use of the BroadcastChannel from the client. The goal of this is to allow us to create a simple test using the clients and manually exchanging messaging, without being coupled to the a browser environment to use the BroadcastChannel.
The approach I took is that all API functions return a message (GlobalMessage|Message|undefined) and every client has a ReceiveMessage function that can be called to ingest the message. This requires a bit more reworking of the existing logic but it means that it should be very easy to start working on a test. The downside is that the existing BroadcastChannel logic is removed and we'll need to wire up listeners to Broadcast Channels outside of the client.
A slightly less destructive approach would be implementing a messaging service that the client can call send and receive on. In test we could use a simple in-memory implementation and use a BroadcastChannel implementation for the browser. That would require less changes to the existing logic but introduce a bit more work to testing, since we'd have to implement a test specific message service.
Fixes #71
This removes the use of the
BroadcastChannel
from the client. The goal of this is to allow us to create a simple test using the clients and manually exchanging messaging, without being coupled to the a browser environment to use theBroadcastChannel
.The approach I took is that all API functions return a message (
GlobalMessage|Message|undefined
) and every client has aReceiveMessage
function that can be called to ingest the message. This requires a bit more reworking of the existing logic but it means that it should be very easy to start working on a test. The downside is that the existingBroadcastChannel
logic is removed and we'll need to wire up listeners to Broadcast Channels outside of the client.A slightly less destructive approach would be implementing a messaging service that the
client
can call send and receive on. In test we could use a simple in-memory implementation and use a BroadcastChannel implementation for the browser. That would require less changes to the existing logic but introduce a bit more work to testing, since we'd have to implement a test specific message service.