- 
 Couldn't load subscription status. 
- Fork 59
 types(OptionalRestArgs): truly only require args input when necessary
 #59
 
 New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is a nice change but we're thinking we want to go the other direction here: we've found it gets complicated to write client-side middleware when it's all conditional on these optional types and would like to move to always requiring args.
This change doesn't make the situation any worse, so I'd like to take it, but it does cause some additional work for wrapping code like convex-helpers that hardcodes the exact optional approach used today.
Hold onto this for when we try out a single-object API for useQuery more like https://tkdodo.eu/blog/the-query-options-api; I think that would give us better separatioe between plumbing layers where middleware needs to e.g. insert an argument or consume an argument and the top usage layer where we can do things like this.
Let's not close this yet, when Ian gets back from PTO we can check, but I think this is the kind of thing that will cause type thrash and we wont' be stuck with it for too much longer.
Uh oh!
There was an error while loading. Please reload this page.
Currently
argsare still required even though all of it's properties are optional, this change addsIsOptionalKeyandAreAllPropertiesOptionalutil types, and use it to achieve "truly necessary requirement only" ofargs.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.