V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
shadeofgod

又撸了个轮子, RPC-styled API for electron ipc

  •  
  •   shadeofgod ·
    zoubingwu · Mar 19, 2020 · 2625 views
    This topic created in 2230 days ago, the information mentioned may be changed or developed.

    https://github.com/shadeofgod/electron-rpc-remote

    // main process
    import ipc from 'electron-rpc-remote';
    
    let count = 0;
    
    ipc.handle({
      inc() {
        count++;
        return count;
      },
    });
    
    // renderer process
    await ipc.invokeMain('inc'); // -> 1
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5955 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 03:32 · PVG 11:32 · LAX 20:32 · JFK 23:32
    ♥ Do have faith in what you're doing.