Added handlers for ipc.
This commit is contained in:
10
electron/ipc-handler.js
Normal file
10
electron/ipc-handler.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const electron = require("electron");
|
||||
|
||||
const { ipcMain } = electron;
|
||||
|
||||
console.log("*** Added IPC Handlers ***");
|
||||
|
||||
ipcMain.on("test-start", (event, arg) => {
|
||||
console.log("Test Start Inbound.", arg);
|
||||
event.sender.send("test-success", { success: true });
|
||||
});
|
||||
@@ -1,11 +1,10 @@
|
||||
const path = require("path");
|
||||
|
||||
require("./ipc-handler");
|
||||
const { app, BrowserWindow } = require("electron");
|
||||
const isDev = require("electron-is-dev");
|
||||
|
||||
// Conditionally include the dev tools installer to load React Dev Tools
|
||||
let installExtension, REACT_DEVELOPER_TOOLS; // NEW!
|
||||
|
||||
if (isDev) {
|
||||
const devTools = require("electron-devtools-installer");
|
||||
installExtension = devTools.default;
|
||||
@@ -45,7 +44,7 @@ function createWindow() {
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(() => {
|
||||
console.log("Ready to launch the app!");
|
||||
console.log("*** Ready to launch the app! ***");
|
||||
createWindow();
|
||||
|
||||
if (isDev) {
|
||||
|
||||
Reference in New Issue
Block a user