Created
July 31, 2020 21:11
-
-
Save fmacedoo/03556b0f3940d2a8b2de6026f47cadc2 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