docs: add Synchronous Messages Fiddle example (#20451)
* docs: add Synchronous Messages Fiddle example * Code review changes * Add OS support info
This commit is contained in:
parent
dcf6f046d9
commit
0fe718b1d9
3 changed files with 65 additions and 0 deletions
|
@ -0,0 +1,9 @@
|
|||
const { ipcRenderer } = require('electron')
|
||||
|
||||
const syncMsgBtn = document.getElementById('sync-msg')
|
||||
|
||||
syncMsgBtn.addEventListener('click', () => {
|
||||
const reply = ipcRenderer.sendSync('synchronous-message', 'ping')
|
||||
const message = `Synchronous message reply: ${reply}`
|
||||
document.getElementById('sync-reply').innerHTML = message
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue