GithubHelp home page GithubHelp logo

vivimice / electron-ipcfy Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 3.0 250 KB

An electron ipc typescript framework

License: MIT License

HTML 5.55% TypeScript 93.41% JavaScript 1.04%
electron ipc typescript

electron-ipcfy's People

Contributors

dependabot[bot] avatar vivimice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

electron-ipcfy's Issues

renderer to renderer

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.