Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Make the RPC call as property access on the Proxy? #19

Closed
esamattis opened this issue Jan 26, 2022 · 4 comments · Fixed by #21
Closed

Make the RPC call as property access on the Proxy? #19

esamattis opened this issue Jan 26, 2022 · 4 comments · Fixed by #21

Comments

@esamattis
Copy link
Collaborator

esamattis commented Jan 26, 2022

Since you are using JS Proxies why not go all in and implement the rpc calls directly as a property access?

Eg. instead of

client.query(queries.greeting, {hello: 'string'})

why not allow

client.greeting({hello: 'string'})

Although with this it could be trickier for the go-to-definition implementation.

@esamattis
Copy link
Collaborator Author

esamattis commented Jan 26, 2022

Also one could argue that "dotted" queries are uglier with this

client["todo.add"]({task: 'string'})

Personally I don't care. I'd just stay with camel casing.

@KATT
Copy link
Member

KATT commented Jan 27, 2022

Also one could argue that "dotted" queries are uglier with this

client["todo.add"]({task: 'string'})

Personally I don't care. I'd just stay with camel casing.

See #6 (comment)

@KATT
Copy link
Member

KATT commented Jan 27, 2022

Eg. instead of

client.query(queries.greeting, {hello: 'string'})

why not allow

client.greeting({hello: 'string'})

I will have a play with this!

@KATT
Copy link
Member

KATT commented Feb 1, 2022

Closing in favor of #26

@KATT KATT closed this as completed Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants