* docs: avoid leaking the `IpcRendererEvent` in `contextBridge` examples * Update docs/fiddles/ipc/pattern-3/preload.js Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * Update docs/tutorial/ipc.md Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * Update docs/tutorial/ipc.md Co-authored-by: David Sanders <dsanders11@ucsbalum.com> --------- Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
		
			
				
	
	
		
			8 lines
		
	
	
	
		
			270 B
			
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			8 lines
		
	
	
	
		
			270 B
			
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
const counter = document.getElementById('counter')
 | 
						|
 | 
						|
window.electronAPI.onUpdateCounter((value) => {
 | 
						|
  const oldValue = Number(counter.innerText)
 | 
						|
  const newValue = oldValue + value
 | 
						|
  counter.innerText = newValue.toString()
 | 
						|
  window.electronAPI.counterValue(newValue)
 | 
						|
})
 |