electric
electric copied to clipboard
Message type doesn't allow discriminating between a ControlMessage and ChangeMessage at the type level.
The code below is unable to discriminate that the message is a ChangeMessage
:
if (message.headers.action === "insert") {
// message is still ControlMessage | ChangeMessage
}
It would be nice if there was a way to discriminate them without having to manually use as