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

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

  •  
  •   shadeofgod ·
    zoubingwu · 2020-03-19 03:08:36 +08:00 · 2269 次点击
    这是一个创建于 1509 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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   ·   我们的愿景   ·   实用小工具   ·   1091 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 23:21 · PVG 07:21 · LAX 16:21 · JFK 19:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.