16 lines
330 B
TypeScript
16 lines
330 B
TypeScript
|
|
// Backend emitter
|
|
//
|
|
const EventEmitter = require('events');
|
|
class BackgroundMitt extends EventEmitter { }
|
|
|
|
export const backgroundMitt = new BackgroundMitt();
|
|
|
|
export const ipcEmit = (channel: string, payload: any) => {
|
|
backgroundMitt.emit('ipc-renderer', {
|
|
endpoint: channel,
|
|
message: payload
|
|
});
|
|
};
|
|
|
|
|