This is a demo of using AppRun in the Electron app.
Click the menu 'Hello' to send a message.
mainWindow.webContents.send('@apprun', '#hello', 'from Electron Main');
The AppRun component, main.tsx, receives the message.
update = {
'#hello': (_, msg) => msg
}
Click the button 'Hello to Electron main process' to send a message.
app.run('@electron', 'hello', 'from', 'Renderer');
The Electron app receives and prints the message.
ipcMain.on('@electron', (_, ...arg) => {
console.log(...arg);
});
- Use npm run dev to start the dev watch
- Use npm start to start Electron
- Use npm run build to build for production