electron-ipcp
Easier asynchronous communication on top of Electron ipc communication using promises.
ipc
+ promise
=> ipc + p
=> ipcp
.
Problem being solved
Sometimes you just need to ask something to the main process
and wait for the response.
electron-ipcp
makes this task easier.
Usage
In renderer process
// async/await style { const sumFromMain = await ipcpRenderer} // or promise style { ipcpRenderer }
In main process
const ipcpMain = ipcpMain
How it works
A randomly named communication channel is created and the module provides a respond
method that use the same channel.
If you need to access the original electron event
, it is available.
event = respond //method to respond to renderer originalEvent // the original electron event