완전히 동일한 두 타입 선언 방식 #180
kim-elijah-sol
started this conversation in
A vs B
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
최근 ColorPicker 컴포넌트 개발 중에 색상을 RGB, HSL, HSV 등으로 변환하는 함수를 개발하게 되었어요.
이때 RGB 반환 타입을
[number,number,number]
으로 선언했는데요, HSL 도 RGB와 마찬가지로 채널이 3가지라 완전히 같은 타입을 생성해야되는 상황이에요.Option 1: 타입 복사
Option 2: 타입 새로 생성
Option 3: 공통 타입 선언
39 votes ·
Beta Was this translation helpful? Give feedback.
All reactions