React, Flux, GraphQL, Hack, HHVM...? All of this and more!
When using conditional types developers can select between two types based on a condition expression. Performing a type relationship test is done with the following syntax:
T extends U ? X : Y
In the example T can be assigned to U if the type is X, but in any case the type has to be Y. The conditional type evaluation is deferred if type variables T or U are in use. Without them it is resolved as X or Y when there is no dependency on a type variable.
Learn more about the feature and more examples in the Pull Request on GitHub: Conditional types #21316Tweet