mirror of https://github.com/electron/electron
7 lines
292 B
JavaScript
7 lines
292 B
JavaScript
const { contextBridge, ipcRenderer } = require('electron/renderer')
|
|
|
|
contextBridge.exposeInMainWorld('electronAPI', {
|
|
onUpdateCounter: (callback) => ipcRenderer.on('update-counter', (_event, value) => callback(value)),
|
|
counterValue: (value) => ipcRenderer.send('counter-value', value)
|
|
})
|