electron/spec/fixtures/module/preload-ipc-ping-pong.js

10 lines
285 B
JavaScript
Raw Normal View History

2020-03-20 20:28:31 +00:00
const { ipcRenderer } = require('electron');
ipcRenderer.on('ping', function (event, payload) {
2020-03-20 20:28:31 +00:00
ipcRenderer.sendTo(event.senderId, 'pong', payload);
});
ipcRenderer.on('ping-æøåü', function (event, payload) {
2020-03-20 20:28:31 +00:00
ipcRenderer.sendTo(event.senderId, 'pong-æøåü', payload);
});