13 lines
378 B
JavaScript
13 lines
378 B
JavaScript
|
const { ipcRenderer } = require('electron')
|
||
|
|
||
|
const asyncMsgBtn = document.getElementById('async-msg')
|
||
|
|
||
|
asyncMsgBtn.addEventListener('click', () => {
|
||
|
ipcRenderer.send('asynchronous-message', 'ping')
|
||
|
})
|
||
|
|
||
|
ipcRenderer.on('asynchronous-reply', (event, arg) => {
|
||
|
const message = `Asynchronous message reply: ${arg}`
|
||
|
document.getElementById('async-reply').innerHTML = message
|
||
|
})
|