From cb0841ab3dedd4958685eca52f7f044fd644de59 Mon Sep 17 00:00:00 2001 From: Donald White <252141+donniewa@users.noreply.github.com> Date: Wed, 8 Feb 2023 20:42:04 -0800 Subject: [PATCH] Update 11-data-fetcher.solution.ts Another way to infer `Awaited` is to use the generic on the `.then` method. --- src/02-passing-type-arguments/11-data-fetcher.solution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/02-passing-type-arguments/11-data-fetcher.solution.ts b/src/02-passing-type-arguments/11-data-fetcher.solution.ts index 85385b6..08ec9cf 100644 --- a/src/02-passing-type-arguments/11-data-fetcher.solution.ts +++ b/src/02-passing-type-arguments/11-data-fetcher.solution.ts @@ -2,7 +2,7 @@ import { expect, it } from "vitest"; import { Equal, Expect } from "../helpers/type-utils"; const fetchData = async (url: string) => { - let data: TData = await fetch(url).then((response) => response.json()); + let data = await fetch(url).then((response) => response.json()); return data; };