Replies: 2 comments 2 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Now we are using this:
Suggested:
@olaf-k :
because I've seen that pattern in different places: Extract<T, U> is useful if you want the intersection of T and U. if you only want some a subset of T, just take what you need.
type SelectAppearance = Extract<Appearance, Appearance.Outlined | Appearance.Ghost>;
is less readable than
type SelectAppearance = Appearance.Outlined | Appearance.Ghost;
@yinonov
because it makes the reader wonder what Extract does, find out what it does, realize it's not needed and wonder why it is used. The second is idiomatic TS and can be read with minimum TS knowledge.
original rised here: #830 (comment)
Beta Was this translation helpful? Give feedback.
All reactions