From 2956e79b057a7814096f847e630bbcedfae7c112 Mon Sep 17 00:00:00 2001 From: leehanur Date: Tue, 10 Jul 2018 20:01:46 +0900 Subject: [PATCH] =?UTF-8?q?interface=20=EA=B4=80=EB=A0=A8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=A4=91=20=EC=9E=98=EB=AA=BB=EB=90=9C=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=B0=8F=20=EC=84=A4=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04-interface-and-class/interface-basics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/04-interface-and-class/interface-basics.md b/04-interface-and-class/interface-basics.md index 24d657f..fdad491 100644 --- a/04-interface-and-class/interface-basics.md +++ b/04-interface-and-class/interface-basics.md @@ -94,8 +94,8 @@ inteface User { readonly height: number; /* ... */ } -const user: MyReponse = await getUserApiCall(userId); -user.name; // 타입 시스템은 user.name이 string임을 알 수 있다. +const res: MyReponse = await getUserApiCall(userId); +res.data.name; // 타입 시스템은 res.data.name이 string임을 알 수 있다. ``` 함수 인터페이스의 정의에도 제너릭을 사용 할 수 있다. 이 경우 타입 변수는 매개변수의 앞에 적는다.