Skip to content

Conversation

@kkak10
Copy link

@kkak10 kkak10 commented Jul 10, 2018

Description

제너릭 인터페이스 설명중에 잘못된 코드가 있어 수정 요청드립니다.

const user: MyReponse<User> = await getUserApiCall(userId);
user.name; // 타입 시스템은 user.name이 string임을 알 수 있다.

user에 들어오는 값은 myResponse Type인데 user.name으로 User type의 property에 바로 접근하는 부분을 수정하였습니다.

제가 드린 변경사항이 아닌 조금 더 간결하게 수정하신다면 아래와 같은 코드도 괜찮을것 같습니다.

const user: MyReponse<User> = await getUserApiCall(userId).data;
user.name; // 타입 시스템은 user.name이 string임을 알 수 있다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant