[1단계 - 행운의 로또 미션] 록바(김상록) 미션 제출합니다#103
Merged
Merged
Conversation
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
- feat: getRandomNumber(min, max) - min ~ max 까지의 로또 번호를 반환해주는 함수 - feat: pickLottoNumber(n) - 중복되지 않는 n개의 로또 번호를 반환해주는 함수 - docs: 기능 요구사항 목록 업데이트 Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
- feat: lotto, lottos 모델 데이터 생성 Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
- feat: 구입한 로또 정보를 뷰와 동기화 - feat: 유동적으로 변하는 요소들을 template으로 분리 Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
- feat: 로또 재구매시, confirm을 사용하여 컨트롤 Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
-refactor: 게임 룰, 에러 메시지, confirm 메시지 상수화 Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
- test: pickLottoNumber, convertToNumber 함수 기능 테스트 Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
-test: Lottos 인스턴스 초기화, Lottos.makeLottos() 기능 테스트 Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
Co-authored-by: intae92 <intae92@users.noreply.github.com> Co-authored-by: LAH1203 <LAH1203@users.noreply.github.com>
-refactor: switch on/off에 따른 두 개의 구조 -> 한 개의 구조로 변경
-chore: 상수화 정보에 Object.freeze()는 오버스펙으로 판단
-refactor: Lottos -> PurchasedLottos -refactor: Lotto -> LottoNumbers
-refactor: shuffleArray(배열의 값을 무작위로 정렬하는 함수) 추가
-refactor: 하나의 이벤트에 대한 수행될 수 있는 controller를 View.js 멤버변수에 저장. -refactor: PurchasedMoneyView -> View를 상속함으로써, 수행될 수 있는 controller을 호출
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
안녕하세요. 로이~
저는 록바입니다. 😄
우선, 로이에게 리뷰를 받게 되어 정말 영광입니다.
저는
코어 자바스크립트를 읽고, 자바스크립트의 세계에 눈을 떴습니다.다른 책들에 비해, 짧은 분량임에도 많은 정보를 습득하고 성장할 수 있었습니다ㅎㅎ
로또 미션 데모 페이지 입니다.
클래스 다이어그램(수정본)
파일 구조도(수정본)
질문사항 🎯
요번 미션의 가장 포인트는 토글에 따른 UI가 변하는 것입니다.
토글이 off인 경우, 로또 이미지만을 렌더링합니다.
토글이 on인 경우, 로또 이미지와 해당 로또 번호를 렌더링합니다.
제가 생각하기에, 위 방식을 구현하는데 2가지 방식이 있다고 생각합니다.
첫번째,
두번째,
첫번째 방식의 장점은, on과 off를 분리하지 않았기 때문에 효율적이라 생각합니다.
그에 반해, 단점은 토글의 상태에 따라 로또 번호를 포함하고 있는 element를 모두 접근하여 class명을 바꿔주어야 합니다.
예를 들어, 사용자가 티켓 100개를 구매하고, 토글을 누르면?
100개의 로또 번호를 포함하는 element에 접근하여 className을 추가or 삭제 해야합니다.
두번째 방식의 단점은, on과 off를 분리하지 않았기 때문에 비효율적이라고 생각합니다.
그에 반해 장점은, 토글의 상태에 따라 로또 번호에 접근할 필요없이 on과 off를 감싸고 있는 최상위 element에만 className를 이용하여 스타일을 제어하면 됩니다.
예를 들어, 사용자가 티켓을 100개 구입하고, 사용자가 토글을 누르면?
최상위 element에만 접근하면 되기 때문에 스타일을 제어하기 편합니다. 다만, on과 off에 각각 티켓에 대한 정보를 담아야합니다.
저희는 두번째 방식을 사용하였는데요.
제가 아직 브라우저 렌더링 과정을 잘 모르지만, 로이가 생각하기에 어떤 방식이 더 현명한 방식인지 궁금합니다.
리뷰어를 진행하면서 많은 디자인 패턴 및 테크닉을 경험할 수 있어서 좋았다라는 글을 본 적이 있는데, 경험해보면 좋을 법한 디자인 패턴을 추천받고 싶습니다.이상입니다.
사소한 지적, 많은 지적 다 환영합니다. 감사합니다. 로이 😄