electron/docs/fiddles/ipc/pattern-3/renderer.js

9 lines
269 B
JavaScript
Raw Normal View History

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)
})