Useful functions for building a PortMessage to be delivered through ports.
Create a new PortMessage with an empty payload.
new "SomeAction" == { tag = "SomeAction", payload = null }Attach a payload to the PortMessage
new "JoinChannel"
|> withPayload (Json.Encode.string "lobby")
== { tag = "JoinChannel", payload = "lobby" }