Skip to content

Latest commit

 

History

History
137 lines (102 loc) · 3.46 KB

module.md

File metadata and controls

137 lines (102 loc) · 3.46 KB

Classes

Module

Functions

send(event, [...data])

Sends an IPC event with data.

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)

Registers a once fired callback to a IPC event.

sendGlobal(event, [...data])

Sends a plain IPC event without namespacing it.

Module

Kind: global class

new Module()

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.

send(event, [...data])

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

respond(event, fetchId, [...data])

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

on(event, callback)

Registers a callback to a IPC event.

Kind: global function
Access: public

Param Type Description
event string event name
callback function callback to fire

removeListener(module, event, callback)

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

removeAllListeners(module, event)

Unregisters all callbacks.

Kind: global function
Access: public

Param Type Description
module string module name
event string name of an event

once(event, callback)

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

sendGlobal(event, [...data])

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