Skip to content

Instantly share code, notes, and snippets.

@fmacedoo
Created July 31, 2020 21:02
Show Gist options
  • Save fmacedoo/075c05d9ad719ed9a0c0158c0a0aa6d3 to your computer and use it in GitHub Desktop.
Save fmacedoo/075c05d9ad719ed9a0c0158c0a0aa6d3 to your computer and use it in GitHub Desktop.
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