Devlog

  • 홈
  • 태그
  • 방명록

typescript 1

Typescript 태그된 유니온 적용에 대하여

1. 태그된 유니온? 이펙티브 타입스크립트 책을 공부하면서, item 32 유니온의 인터페이스보다는 인터페이스의 유니온을 사용하기 파트에서 볼 수 있습니다. 아래와 같은 인터페이스가 있습니다. interface Layer { layout: FillLayout | LineLayout | PointLayout; paint: FillPaint | LinePaint | PointPaint; } layout 이 LineLayout 이면서 paint 속성이 FillPaint 타입인 것은 다소 잘못된 설계 방식을 의미합니다. 이러한 조합을 라이브러리에서 허용한다면, 분명 오류가 발생할 여지를 제공하는 것이며, 이는 인터페이스를 다루는데 있어 많은 어려움을 야기시킵니다. 이를 개선하기 위해선 아래와 같이 각각 타입의 ..

typescript 2022.03.20
이전
1
다음
더보기
프로필사진

Devlog

  • 분류 전체보기 (18)
    • react (2)
    • javascript (0)
    • seo (0)
    • flutter (5)
    • python (6)
    • 공공데이터 (1)
    • 알고리즘 (1)
    • typescript (1)
    • machine-learning (1)
    • 디자인 (0)

Tag

No supported devices connected, Error: android:exported needs to be explicitly specified for <activity>, 태그된 유니온, React dev Tool, flutter_native_splash, JavaScript, effective typescript, react, Apple Silicon M1, 의약품개요정보(e약은요), Refactoring UI, H-Index, One or more plugins require a higher Android SDK version, airbnb_redesign_ui, Your Flutter application is created using an older version of the Android embedding, React conf 2021, Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01, Google Login, Flutter, Google 로그인 구현,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

Copyright © Kakao Corp. All rights reserved.

티스토리툴바