rspc
rspc copied to clipboard
feat(proxy): initial support
Provide an a index based access to running query/mutate/subscribe with support for nested keys and keys with different operations e.g.
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??
further experiment and development will temporarily located in https://github.com/kkharji/rspc-proxy
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.