vivimice / electron-ipcfy Goto Github PK
View Code? Open in Web Editor NEWAn electron ipc typescript framework
License: MIT License
An electron ipc typescript framework
License: MIT License
Hello,
I'm trying to use the library but I'm not able to get it to work. I have a fairly simple use case. I have two renderer windows. The second is opened by the first using new BrowserWindow. In the second I want to send a message to the first after some work completes. In the first I then react to the message. However I'm not receiving the message in the first one.
Here is my simple service:
import { ipcfy } from 'electron-ipcfy';
export interface MosaicToPdfServiceInterface {
readyToPrint(winid: number): void;
}
export const mosaicPdfService = ipcfy<MosaicToPdfServiceInterface>('mosaictopdf');
In the first renderer I attach an implementation:
mosaicPdfService.__attachImpl(new class implements MosaicToPdfServiceInterface {
public readyToPrint(winid: number): void {
debugger;
console.log('got message from print window ' + winid);
}
});
Then in the second renderer I call the service:
mosaicPdfService.readyToPrint(remote.getCurrentWindow().id);
However I never get the message in the first renderer.
Debugging the call to readyToPrint, I get to equivalent of line 270 of IpcRegistry.ts, then in the call to probeRemoteHandlerLocation I get to line 298 (ipcRenderer.send(queryChannel, topic);) after that I'm not able to follow the debugging well.
Is there something I'm missing? It's an Angular app (7.2.14) but I don't think that should matter.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.