Replies: 3 comments
-
I use this syntax to defer the evaluation of a type... Otherwise TS evaluates all the types in their full depth. This causes performance issues and is irrelevant because we only want to compute when we've received the type parameters. As a result, the ts-toolbelt types load fast. But it is not the only use case. Like I said above, TS can complain that a type is too deep to compute, then you can force it to compute step by step. So I especially use this on recursive types (which are much deeper because they're recursive). |
Beta Was this translation helpful? Give feedback.
-
Can you add an example of real code from this project that does this to this wiki entry? It's hard to understand if/how |
Beta Was this translation helpful? Give feedback.
-
You can check this example out |
Beta Was this translation helpful? Give feedback.
-
🤔 Question
Describe your question
The whole codebase is full of
<x> extends infer X ? <y>: never
Search tags, topics
#extends #infer #lots #used
Beta Was this translation helpful? Give feedback.
All reactions