rspc icon indicating copy to clipboard operation
rspc copied to clipboard

feat(proxy): initial support

Open kkharji opened this issue 1 year ago • 1 comments

Provide an a index based access to running query/mutate/subscribe with support for nested keys and keys with different operations e.g.

rspc-demo

client.version.query();
client.sendMsg.mutate("Hello using proxy");
client.pings.subscribe([], {
    onData(msg) { console.log(msg) }
})
  • [x] client: don't break current api
  • [ ] hooks: don't break current api
  • [ ] types: Always pass an array of arguments? even when it's empty??

kkharji avatar Oct 16 '22 14:10 kkharji

further experiment and development will temporarily located in https://github.com/kkharji/rspc-proxy

kkharji avatar Oct 17 '22 15:10 kkharji

Does it make sense to turn snake_case keys into camelCase? It feels weird to me to introduce a different notation in the Rust project so I created my own proxy (POC) that also converts those. E.g. 'controller.sign_in' -> 'controller.signIn'. It's a bit tricky to not convert the final method calls so requires a few more checks.

radoslavkarlik avatar Nov 09 '22 11:11 radoslavkarlik