electron/docs/fiddles/ipc/pattern-3/renderer.js
2022-03-16 11:01:29 -04:00

8 lines
275 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.sender.send('counter-value', newValue)
})