We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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) - you will get a bunch of errors.
The solution is as following:
const fetchData = async <T>(url: string): Promise<T> => await fetch(url).then(resp => resp.json as T)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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) - you will get a bunch of errors.
The solution is as following:
The text was updated successfully, but these errors were encountered: