9 lines
283 B
JavaScript
9 lines
283 B
JavaScript
const { contextBridge, ipcRenderer, ipcMain } = require('electron')
|
|
|
|
contextBridge.exposeInMainWorld('functions', {
|
|
run: (value) => ipcRenderer.invoke('run', value),
|
|
onTaskCompleted: (callback) => ipcRenderer.on('task-completed', (_event, value) => {
|
|
callback(value)
|
|
})
|
|
})
|