Constructor
new Server(handlers, defaultHandleropt)
Constructs a Server instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
handlers |
object | The object whose methods will be exposed over JSON-RPC. Each method may return either a Promise, a plain value, or nothing at all. |
|
defaultHandler |
MessageEventHandler |
<optional> |
This callback is invoked when a |
- Source:
Methods
mount(window)
Start listening for message
events.
Parameters:
Name | Type | Description |
---|---|---|
window |
Window | The browser window to which a handler will be attached. |
- Source:
unmount(window)
Stop listening for message
events.
Parameters:
Name | Type | Description |
---|---|---|
window |
Window | The browser window from which the handler will be detached. |
- Source: