MCPcopy
hub / github.com/nanbingxyz/5ire / on

Function on

src/main/preload.ts:296–304  ·  view source on GitHub ↗
(channel: Channels, func: (...args: unknown[]) => void)

Source from the content-addressed store, hash-verified

294 ipcRenderer.send(channel, ...args);
295 },
296 on(channel: Channels, func: (...args: unknown[]) => void) {
297 const subscription = (_event: IpcRendererEvent, ...args: unknown[]) => {
298 func(...args);
299 };
300 ipcRenderer.on(channel, subscription);
301 return () => {
302 ipcRenderer.removeListener(channel, subscription);
303 };
304 },
305 once(channel: Channels, func: (...args: unknown[]) => void) {
306 ipcRenderer.once(channel, (_event, ...args) => func(...args));
307 },

Callers

nothing calls this directly

Calls 1

onMethod · 0.80

Tested by

no test coverage detected