1
0
mirror of https://github.com/rhysd/Mstdn.git synced 2025-01-21 20:52:11 +01:00
Mstdn/renderer/ipc.ts

12 lines
333 B
TypeScript
Raw Normal View History

2017-04-16 02:27:06 +09:00
import log from './log';
import r from './require';
const electron = r('electron');
const ipc = electron.ipcRenderer;
2017-04-16 12:44:53 +09:00
export function on(channel: IpcChannel, callback: (...args: any[]) => void) {
2017-04-16 02:27:06 +09:00
ipc.on(channel, (...args: any[]) => {
2017-04-16 02:57:54 +09:00
log.debug('IPC: Received from:', channel, args);
2017-04-16 02:27:06 +09:00
callback(...args);
});
}