off(channel, callback) } }, // otherwise if using @electron-toolkit/preload or electron-vite // which expose a custom `on` method that does the above for you // on: window.electron.ipcRenderer.on, send: window.ipcRenderer.send, }) Let's say you're using React, you can now ...
off(channel, callback) } }, // otherwise if using @electron-toolkit/preload or electron-vite // which expose a custom `on` method that does the above for you // on: window.electron.ipcRenderer.on, send: window.ipcRenderer.send, }) Let's say you're using React, you can now ...
To use Microsoft Graph Toolkit components in your applications, they must be registered in the browser window that they open. To do this, you must import the register functions for each component you want to use. To initialize theElectronContextBridgeProviderand register the Microsoft Graph Toolkit...
import{typeIpcRendererEvent, contextBridge, ipcRenderer }from'electron';import{ AuthenticationProviderOptions }from'@microsoft/microsoft-graph-client'; contextBridge.exposeInMainWorld("main", { electronProvider: { mgtAuthState:(callback: (event: IpcRendererEvent, authState:string) =>void) =>ipcRendere...
{window.ipcRenderer.on(channel,callback)return()=>{window.ipcRenderer.off(channel,callback)}},// otherwise if using @electron-toolkit/preload or electron-vite// which expose a custom `on` method that does the above for you// on: window.electron.ipcRenderer.on,send:window.ipcRenderer.send...