Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

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

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.