typescript-generics-workshop icon indicating copy to clipboard operation
typescript-generics-workshop copied to clipboard

Interactive tutorial on using generics in TypeScript

Results 26 typescript-generics-workshop issues
Sort by recently updated
recently updated
newest added
trafficstars

The test description for ex 03 refers to a tuple being returned when it's an object.

> #35-form-validator exercice Small question / suggestion regarding the typing of the errors object: wouldn't it be better to return a partial object to make the autocomplete indicating the possible...

+No function overloads +Can pass infinite args to compose function

You have a comment in the 14.5-literal-inference.explainer.ts file: ```typescript // When returning the value only, it infers // the literal type const returnsValueOnly = (t: T) => { return t;...

The provided code in the video does not seem to be working. https://github.com/total-typescript/typescript-generics-workshop/blob/main/src/02-passing-type-arguments/11-data-fetcher.solution.ts If you take the code and paste it into **Typescript playground** ([I have done it for you](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgUwB5mQYxgGjseAXzgDMoIQ4AiANwOQGcYqBuAKFElkTgFEBHAK4BDADZ5e6LEVLlKVAAIwAnhgC0mABZjRyAHYBzRgHpBMYKIas2bTBD1NSyGFoAiwmMLgBeOMIbKephwADwAKu6eAHwAFIJQogBccExQwIYAlD5RiGxwcLrwACYewskRpT5+AO7CBE4umnEJGQB0MJr6MTFQjJAOyFneOb0M-QzIrQBWDPYxGRnseXC9MPF6cCWe7IRLBDFUAMqaEIKiRQ1am5VkFH4bAIIACgCSVHj+gcHz2bn5dg5ipVfMJavUSM43KUQkg9MIQMhkql0gY4IRYst8lRNDAYGAGIljMYGLUwMBWkVkDRjMIycYMBAwLpjABGKjLRbLNAYbAxLbCVpwhFtGAQAQiUQHAAyggA1sg4IdZcpaqJ5VAqJzlioMHAYIwYAwqgBtSQ8mAhcViEI65AQEjXTx4WHwxEpGBpQxoqJRAC6O0WQA))...

It is possible to enter a generic type argument for the `then` function. This seems more intuitive to me than typing data. But in this way, the `const data` is...

Add a new solution to `29.5-pick` that doesn't use Pick.

On this exercise, extending T on U and V makes it possible to pass the test. This new test checks that the type of each function argument is independent from...

Another way to infer `Awaited` is to use the generic on the `.then` method.