Created
July 31, 2020 21:02
-
-
Save fmacedoo/075c05d9ad719ed9a0c0158c0a0aa6d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ipcMain } = require('electron'); | |
ipcMain.on('asynchronous-message', (event, arg) => { | |
console.log(arg); // prints "ping" | |
if (arg === 'ping') event.reply('asynchronous-reply', 'pong!'); | |
else event.reply('asynchronous-reply', 'please, send me ping.'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment