Last active
July 31, 2020 13:16
-
-
Save fmacedoo/4ab53127de8805ffbf64525d3a857b98 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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