workflow_launcher/preload.js
2024-05-24 08:25:41 +02:00

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