OnError registers a function to be called when there is an error with the WebSocket.
(fn func(e js.Value))
| 91 | // OnError registers a function to be called when there is an error |
| 92 | // with the WebSocket. |
| 93 | func (c WebSocket) OnError(fn func(e js.Value)) (remove func()) { |
| 94 | return c.addEventListener("error", fn) |
| 95 | } |
| 96 | |
| 97 | // MessageEvent is the type passed to a message handler. |
| 98 | type MessageEvent struct { |