Type Selection Queries #41109
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
This might be a bit of a crazy idea, but here goes: to enable loose coupling between components we sometimes write Pick<Type, 'a' | 'b' | 'c'>
It would be nice if we could create a type query to select properties with a similar syntax to GraphQL:
e.g:
This would be equivalent to
How often would you do that in "the real world" ? definitely more often if you could
How often should you do that? unclear ?
Some real-world code:
Pick<Response, 'ok' | 'json'>
could beResponse[{ok, json}]
edit: that's not a great example use case, cause you could just as well do
Partial<Response>
The text was updated successfully, but these errors were encountered: