e9a43be9be
* docs: add IPC doc * fix: use "string" primitive * use 'string' ipcrenderer * use "number" primitive * Update docs/tutorial/ipc.md Co-authored-by: Jeremy Rose <nornagon@nornagon.net> * Update docs/tutorial/ipc.md Co-authored-by: Jeremy Rose <nornagon@nornagon.net> * add code sample Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
8 lines
269 B
JavaScript
8 lines
269 B
JavaScript
const counter = document.getElementById('counter')
|
|
|
|
window.electronAPI.handleCounter((event, value) => {
|
|
const oldValue = Number(counter.innerText)
|
|
const newValue = oldValue + value
|
|
counter.innerText = newValue
|
|
event.reply('counter-value', newValue)
|
|
})
|