Skip to content

Instantly share code, notes, and snippets.

@fmacedoo
Last active July 31, 2020 13:16
Show Gist options
  • Save fmacedoo/4ab53127de8805ffbf64525d3a857b98 to your computer and use it in GitHub Desktop.
Save fmacedoo/4ab53127de8805ffbf64525d3a857b98 to your computer and use it in GitHub Desktop.
const electron = window.require('electron');
const { ipcRenderer } = electron;
export default function send(message) {
return new Promise((resolve) => {
ipcRenderer.once('asynchronous-reply', (_, arg) => {
resolve(arg);
});
ipcRenderer.send('asynchronous-message', message);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment