-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5팀 노현진] Chapter 2-2 디자인패턴과 함수형 프로그래밍 #12
Open
Nohyunjin
wants to merge
44
commits into
hanghae-plus:main
Choose a base branch
from
Nohyunjin:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,265
−728
Conversation
This file contains 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
- origin/App.tsx의 handle 함수들 이식
- getAppliedDiscount -> getMaxApplicableDiscount - updateQuantity -> updateCartItemQuantity - calculateTotal -> calculateCartTotal - calculateCartTotal는 카트 전체의 아이템을 계산하는 역할만 하기 위해 함수를 분리 - calculateItemTotal 구현 -> map 함수의 콜백 함수로 구현
- origin/CartPage.tsx의 addToCart, removeFromCart, updateQuantity, applyCoupon,calculateTotal을 useCart.ts에 이식
- origin/App.tsx의 handleCouponAdd 이식
- calculateItemTotal의 return이 '할인이전가격', '할인이후가격', '할인가격' 3개라, test code를 수정하여 진행 - testcode를 수정하지 않은 버전도 PR 예정
- 할인전, 할인후, 할인가격 세가지를 리턴하던 방식에서 할인후 가격만 return
- itemTotal로 명명했던 애매한 변수명을 itemDiscountStatus라는 명확한 명으로 수정
- page는 views 폴더로
- CartItem.tsx -> 장바구니 내역 - Products.tsx -> 상품 리스트 - Button.tsx -> 버튼 - TextInput.tsx -> input
- useEffect로 제품 수정 상태일 때 비정상 값으로 저장되지 않도록 버튼 disable 기능 추가
- hooks/utils에서 /utils로
- DiscountType enum 타입 추가
- 테스트 코드와 물려있어 value를 대문자로 설정 불가.
- view 페이지에서는 버튼 동작과 관련된 handle함수만 두고 함수는 utils에서 활용
- Products 컴포넌트는 CartProducts 로 명칭 변경
- calculateCartTotal의 반환값이 Discount 값들이라 함수명을 더 명확하게 변경
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.
과제 체크포인트
기본과제
React의 hook 이해하기
함수형 프로그래밍에 대한 이해
Component에서 비즈니스 로직을 분리하기
비즈니스 로직에서 특정 엔티티만 다루는 계산을 분리하기
Component에서 사용되는 Data가 아닌 로직들은 hook으로 옮겨졌나요?
주어진 hook의 책임에 맞도록 코드가 분리가 되었나요?
계산함수는 순수함수로 작성이 되었나요?
심화과제
뷰데이터와 엔티티데이터의 분리에 대한 이해
엔티티 -> 리파지토리 -> 유즈케이스 -> UI 계층에 대한 이해
Component에서 사용되는 Data가 아닌 로직들은 hook으로 옮겨졌나요?
주어진 hook의 책임에 맞도록 코드가 분리가 되었나요?
계산함수는 순수함수로 작성이 되었나요?
특정 Entitiy만 다루는 함수는 분리되어 있나요?
특정 Entitiy만 다루는 Component와 UI를 다루는 Component는 분리되어 있나요?
데이터 흐름에 맞는 계층구조를 이루고 의존성이 맞게 작성이 되었나요?
리뷰 받고 싶은 내용
궁금한 점
과제를 수행하면서 느낀점
과제 시작 전 생각
과제 제출 후 생각
기타
과제 난이도