V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
shadeofgod
V2EX  ›  分享创造

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

  •  
  •   shadeofgod ·
    zoubingwu · 2020 年 3 月 19 日 · 2588 次点击
    这是一个创建于 2213 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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
    
    目前尚无回复
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   956 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 19:34 · PVG 03:34 · LAX 12:34 · JFK 15:34
    ♥ Do have faith in what you're doing.