Skip to content

⬅️ Back to Table of Contents

📄 useIpcRendererInvoke

📊 Analysis Summary

Metric Count
🔧 Functions 1
📦 Imports 3

📚 Table of Contents

🛠️ File Location:

📂 packages/electron/useIpcRendererInvoke/index.ts

📦 Imports

Name Source
IpcRenderer electron
ShallowRef vue
shallowRef vue

Functions

useIpcRendererInvoke(ipcRenderer: IpcRenderer, channel: string, args: any[]): ShallowRef<T | null>

Returns Promise - Resolves with the response from the main process.

Send a message to the main process via channel and expect a result ~~asynchronously~~. As composition-api, it makes asynchronous operations look like synchronous.

You need to provide ipcRenderer to this function.

See: https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args, https://vueuse.org/useIpcRendererInvoke

Tags: @__NO_SIDE_EFFECTS__

Raw JSDoc
/**
 * Returns Promise<any> - Resolves with the response from the main process.
 *
 * Send a message to the main process via channel and expect a result ~~asynchronously~~. As composition-api, it makes asynchronous operations look like synchronous.
 *
 * You need to provide `ipcRenderer` to this function.
 *
 * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
 * @see https://vueuse.org/useIpcRendererInvoke
 *
 * @__NO_SIDE_EFFECTS__
 */
Code
export function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: string, ...args: any[]): ShallowRef<T | null>

Generated by Syntax Scribe