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
Add new mapped-type for intersection more than two classes #339
Comments
Might be a bit ugly, but as these types are composable you could do something like const BasetemplateQueryDto extends IntersectionType(
IntersectionType(
BaseTemplateFiltering,
LimitOffsetQuery
),
SortByQuery
) {} Just a thought until there's an official verdict on this. Don't immediately know what would happen to duplicate keys, what kind of precedence would take, so be wary of that. |
Would you like to create a PR for this issue? We can let `IntersectionType accept a spread arg (infinite number of args) and just combine them all. |
Okay, i'll try this week |
A bit off-topic question, but why is this function called intersection when it actually gives a union of the given types? Personally I understand the intersection as something that exists in all given places 🤔 |
@altick Yep it was a bit stange for me tooo intersection should be something like this, but now it's work as union |
@trycontrolmymind @altick check out this link https://www.reddit.com/r/typescript/comments/9qduq3/why_is_type_intersection_called_like_that_its/ to learn more on why we (and TypeScript itself) use Intersection/Union names here. Let's track this here #341 |
Could someone review PR #341 with new functionality, after that I could edit documentation after review. |
I'm submitting a...
Current behavior
Wanted behavior
I don't think is it possible to do things such this...
The text was updated successfully, but these errors were encountered: