Support for standard schema on hooks like useList #7413
JuicyBenjamin
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not entirely sure how this implementation would look like, but I do think it would be cool if I could just pass a schema and the hook automatically spits out the data as usual, but now validated against the schema and typed without having to pass a type generic.
My reasoning is this, generics are nice, as long as they are correct, but we don't really have a way to validate that isn't very cumbersome. Currently I imagine that if I wanted validation it would have to be done after the fact on each implementation.
I think we could hit two birds with one stone here and somehow accept the name of the resource through the passed schema, that way we kinda get type safety on the resource as well.
Hope this makes sense. Lemme know if you like the idea if you'd like me to contribute to the implementation :D
Beta Was this translation helpful? Give feedback.
All reactions