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