Appearance
useIpcRendererInvoke
Reactive ipcRenderer.invoke API result. Make asynchronous operations look synchronous.
Demo
Usage
tsx
import { useIpcRendererInvoke } from '@reause/electron'
// enable nodeIntegration if you don't provide ipcRenderer explicitly
// see: https://www.electronjs.org/docs/api/webview-tag#nodeintegration
const result = useIpcRendererInvoke<string>('custom-channel', 'some data')Type Declarations
ts
export function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: string, ...args: any[]): T | null
export function useIpcRendererInvoke<T>(channel: string, ...args: any[]): T | null