Documentation
¶
Rendered for js/wasm
Overview ¶
Package message provides a generic mechanism for sending messages to and receiving replies from a Service Worker. The application defines its own message types and commands on top of this transport.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterReplyType ¶
func RegisterReplyType(msgType string)
RegisterReplyType registers a message type that the listener should capture. Must be called before Send for each expected reply type.
Types ¶
type Reply ¶
Reply represents the response received from the Service Worker.
func Send ¶
Send sends a message to the Service Worker and blocks until a reply is received. The "type" and "requestId" fields are added automatically to the msg map. replyType is the message type that the SW should use in the response.
Click to show internal directories.
Click to hide internal directories.