初始化提交
This commit is contained in:
23
common/modules/mixly-modules/electron/events.js
Normal file
23
common/modules/mixly-modules/electron/events.js
Normal file
@@ -0,0 +1,23 @@
|
||||
goog.loadJs('electron', () => {
|
||||
|
||||
goog.require('Mixly.Command');
|
||||
goog.require('Mixly.Config');
|
||||
goog.require('Mixly.Electron');
|
||||
goog.provide('Mixly.Electron.Events');
|
||||
|
||||
const { Command, Config, Electron } = Mixly;
|
||||
const { Events } = Electron;
|
||||
const { SOFTWARE } = Config;
|
||||
|
||||
const electron = Mixly.require('electron');
|
||||
const ipcRenderer = electron.ipcRenderer;
|
||||
|
||||
ipcRenderer.on('command', (event, message) => {
|
||||
if (SOFTWARE.debug) {
|
||||
console.log('receive -> ', message);
|
||||
}
|
||||
const commandObj = Command.parse(message);
|
||||
Command.run(commandObj);
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user