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
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).
millsp
changed the title
Why is <x> extends infer X ? <y>: never so used in the codebase?
Why is <x> extends infer X ? <y>: never so used?
Jun 26, 2019
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 x and X are related in your pseudocode <x> extends infer X ? <y>: never (or if the x's are even relevant, which I think they aren't)
馃 Question
Describe your question
The whole codebase is full of
<x> extends infer X ? <y>: never
Search tags, topics
#extends #infer #lots #used
The text was updated successfully, but these errors were encountered: