OnOpen registers a function to be called when the WebSocket is opened.
(fn func(e js.Value))
| 129 | |
| 130 | // OnOpen registers a function to be called when the WebSocket is opened. |
| 131 | func (c WebSocket) OnOpen(fn func(e js.Value)) (remove func()) { |
| 132 | return c.addEventListener("open", fn) |
| 133 | } |
| 134 | |
| 135 | // Close closes the WebSocket with the given code and reason. |
| 136 | func (c WebSocket) Close(code int, reason string) (err error) { |
no test coverage detected