https://github.com/shadeofgod/electron-rpc-remote
// main process
import ipc from 'electron-rpc-remote';
let count = 0;
ipc.handle({
inc() {
count++;
return count;
},
});
// renderer process
await ipc.invokeMain('inc'); // -> 1
https://github.com/shadeofgod/electron-rpc-remote
// main process
import ipc from 'electron-rpc-remote';
let count = 0;
ipc.handle({
inc() {
count++;
return count;
},
});
// renderer process
await ipc.invokeMain('inc'); // -> 1