V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
mrthanlon
V2EX  ›  JavaScript

介绍一个 RPC 库/框架 remux

  •  
  •   mrthanlon · 180 天前 · 639 次点击
    这是一个创建于 180 天前的主题,其中的信息可能已经有所发展或是发生改变。
    用法类似这样

    ```javascript
    // @remux server
    function serverFunction() {
    console.log('Ouch!')
    }

    // @remux browser
    {
    // put browser code here
    const btn = document.createElement('button')
    btn.innerText = 'Hit me'
    btn.addEventListener('click', () => serverFunction())
    document.body.appendChild(btn)
    }
    ```
    serverFunction 会运行在服务器,Ouch!会在服务器的控制台打出

    最初是受到 remix 启发,另外近期 react 也整了 react server components ,比较像

    https://remuxjs.github.io/docs/zh_CN/master/start/brief.html
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2902 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 14:39 · PVG 22:39 · LAX 07:39 · JFK 10:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.