IPC listener which will cache the callbacks for easily clear.
npm install --save electron-ipc-listenerconst IpcListener = require('electron-ipc-listener');
let ipcListener = new IpcListener();
ipcListener.on('foo:bar', event => {
// do something...
});
// ...
// ...
// once you do not need the ipcListener ...
ipcListener.clear();messagestringcallbackfunction
Register IPC message and respond it with the callback function.
messagestringcallbackfunction
Register IPC message and respond it once with the callback function.
Clear all registered IPC messages in the listener.
MIT © 2017 Johnny Wu