docs: add IPC doc (#32059)
* 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>
This commit is contained in:
parent
254dbd7400
commit
e9a43be9be
22 changed files with 798 additions and 184 deletions
8
docs/fiddles/ipc/pattern-3/renderer.js
Normal file
8
docs/fiddles/ipc/pattern-3/renderer.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
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)
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue