mirror of
https://github.com/rhysd/Mstdn.git
synced 2024-11-28 20:24:10 +01:00
12 lines
335 B
TypeScript
12 lines
335 B
TypeScript
import log from './log';
|
|
import r from './require';
|
|
const electron = r('electron');
|
|
const ipc = electron.ipcRenderer;
|
|
|
|
export function on(channel: IpcChannel, callback: (...args: any[]) => void) {
|
|
ipc.on(channel, (_, ...args: any[]) => {
|
|
log.info('IPC: Received from:', channel, args);
|
|
callback(...args);
|
|
});
|
|
}
|