electron-ipc-rpc-without-timeouts
v1.0.2
Published
Allows communication between Electron's IPC-Main and IPC-Renderer processes with support for callbacks
Downloads
1
Maintainers
Readme
electron-ipc-rpc-without-timeouts
Allows communication between Electron's IPC-Main and IPC-Renderer processes with support for callbacks
Usage
main
const Rpc = require('electron-ipc-rpc');
const rpc = new Rpc(electron.ipcMain, mainWindow.webContents);
rpc.on('method2', (params, callback) => {
callback(null, 'method2 response!');
});
rpc.send('method1', [], (err, res) => {
console.log(res);
});
renderer
const Rpc = require('electron-ipc-rpc');
const rpc = new Rpc(electron.ipcRenderer);
rpc.on('method1', (params, callback) => {
callback(null, 'method1 response');
});
rpc.send('method2', [], (err, res) => {
console.log(res);
});
License
MIT © Daniel Nieto forked from Sebastian Raff