November 2019
Beginner
436 pages
8h 52m
English
You can also send messages back to the main process with the send function:
ipcRenderer.send('<channel-name>', arg);
As an exercise, let's send a confirmation back to the main process. Electron provides convenient access to the sender of the message via the event argument. This allows us to have generic message handlers wired with multiple channels.
The Node.js part of the application is going to listen to the editor-reply channel to receive feedback from the web page.
<script> const { ipcRenderer } = require('electron'); ipcRenderer.on('editor-event', (event, arg) => { console.log(arg); // send message back to main ...Read now
Unlock full access