- send(event, [...data])
Sends an IPC event with data.
- fetch(event, timeout, ...args) ⇒
Promise Fetches some data from renderer process by sending an IPC event and waiting for a response. Returns a promise that resolves when the response is received.
- call(event, ...args) ⇒
Promise Module.fetch without the need to provide a timeout value.
- setDefaultFetchTimeout(timeout)
Sets the default fetch timeout.
- respond(event, fetchId, [...data])
Sends and IPC event response for a provided fetch id.
- on(event, callback)
Registers a callback to a IPC event.
- removeListener(module, event, callback)
Unregisters a callback.
- removeAllListeners(module, event)
Unregisters all callbacks.
- once(event, callback, response)
Registers a once fired callback to a IPC event.
- sendGlobal(event, [...data])
Sends a plain IPC event without namespacing it.
Simple abstraction over electron's IPC. Ensures modules will not conflict with each other by providing events namespace. It is also a security layer as it is the only communication channel between your app and node environment.
Sends an IPC event with data.
Kind: global function
Access: public
| Param | Type | Description |
|---|---|---|
| event | string |
event name |
| [...data] | * |
data to send with the event |
Fetches some data from renderer process by sending an IPC event and waiting for a response. Returns a promise that resolves when the response is received.
Kind: global function
Access: public
| Param | Type | Description |
|---|---|---|
| event | string |
name of an event |
| timeout | number |
how long to wait for the response in milliseconds |
| ...args | * |
arguments to send with the event |
Module.fetch without the need to provide a timeout value.
Kind: global function
Access: public
| Param | Type | Description |
|---|---|---|
| event | string |
name of an event |
| ...args | * |
arguments to send with the event |
Sets the default fetch timeout.
Kind: global function
| Param | Type |
|---|---|
| timeout | number |
Sends and IPC event response for a provided fetch id.
Kind: global function
Access: public
| Param | Type | Description |
|---|---|---|
| event | string |
event name |
| fetchId | number |
fetch id that came with then event you are responding to |
| [...data] | * |
data to send with the event |
Registers a callback to a IPC event.
Kind: global function
Access: public
| Param | Type | Description |
|---|---|---|
| event | string |
event name |
| callback | function |
callback to fire |
Unregisters a callback.
Kind: global function
Access: public
| Param | Type | Description |
|---|---|---|
| module | string |
module name |
| event | string |
name of an event |
| callback | function |
listener to unregister |
Unregisters all callbacks.
Kind: global function
Access: public
| Param | Type | Description |
|---|---|---|
| module | string |
module name |
| event | string |
name of an event |
Registers a once fired callback to a IPC event.
Kind: global function
Access: public
| Param | Type | Description |
|---|---|---|
| event | string |
event name |
| callback | function |
callback to fire |
| response | boolean |
whether we are listening for fetch response |
Sends a plain IPC event without namespacing it.
Kind: global function
Access: public
| Param | Type | Description |
|---|---|---|
| event | string |
event name |
| [...data] | * |
data to send with the event |