963 markdown files reformatted with the repository's pinned prettier so pnpm format:check covers the folded tree like every other repo file. The formatter's embedded-language pass also normalized code fences (TS semicolons, closed HTML tags in examples, lowercased CSS hex colors, one renumbered list that skipped an index). Alphanumeric token deltas vs the fold commit were audited file-by-file; all are formatter-equivalent markup normalizations plus the four sanitized skills.
1.8 KiB
1.8 KiB
category
| category |
|---|
| @Electron |
useIpcRendererInvoke
Reactive ipcRenderer.invoke API result. Make asynchronous operations look synchronous.
Usage
import { useIpcRendererInvoke } from '@vueuse/electron';
import { computed } from 'vue';
// enable nodeIntegration if you don't provide ipcRenderer explicitly
// see: https://www.electronjs.org/docs/api/webview-tag#nodeintegration
// Ref result will return
const result = useIpcRendererInvoke<string>('custom-channel', 'some data');
const msg = computed(() => result.value?.msg);
Type Declarations
/**
* 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__
*/
export declare function useIpcRendererInvoke<T>(
ipcRenderer: IpcRenderer,
channel: string,
...args: any[]
): ShallowRef<T | null>;
/**
* 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.
*
* `ipcRenderer` will be automatically gotten.
*
* @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
* @see https://vueuse.org/useIpcRendererInvoke
*
* @__NO_SIDE_EFFECTS__
*/
export declare function useIpcRendererInvoke<T>(
channel: string,
...args: any[]
): ShallowRef<T | null>;