You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a way to define higher order type alias (such as Pick<>) which can apply the type transformation on each type with an union type, instead of combining them together into one type.
Use Cases
Using Pick<> or Omit<> on Discriminated Union types cause the result type no longer a discriminated union.
Search Terms
pick, union, transitive, type alias
Suggestion
Provide a way to define higher order type alias (such as
Pick<>
) which can apply the type transformation on each type with an union type, instead of combining them together into one type.Use Cases
Using
Pick<>
orOmit<>
on Discriminated Union types cause the result type no longer a discriminated union.Examples
The problem is
Omit<Action, 'id'>
creates this type:instead of
Using
Pick<>
has the same problem, but useOmit<>
in the example for a cleaner use-case.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: