Skip to content
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
wants to merge 44 commits into
base: main
Choose a base branch
from

Conversation

Nohyunjin
Copy link

@Nohyunjin Nohyunjin commented Oct 21, 2024

과제 체크포인트

기본과제

  • React의 hook 이해하기

  • 함수형 프로그래밍에 대한 이해

  • Component에서 비즈니스 로직을 분리하기

  • 비즈니스 로직에서 특정 엔티티만 다루는 계산을 분리하기

  • Component에서 사용되는 Data가 아닌 로직들은 hook으로 옮겨졌나요?

  • 주어진 hook의 책임에 맞도록 코드가 분리가 되었나요?

  • 계산함수는 순수함수로 작성이 되었나요?

심화과제

  • 뷰데이터와 엔티티데이터의 분리에 대한 이해

  • 엔티티 -> 리파지토리 -> 유즈케이스 -> UI 계층에 대한 이해

  • Component에서 사용되는 Data가 아닌 로직들은 hook으로 옮겨졌나요?

  • 주어진 hook의 책임에 맞도록 코드가 분리가 되었나요?

  • 계산함수는 순수함수로 작성이 되었나요?

  • 특정 Entitiy만 다루는 함수는 분리되어 있나요?

  • 특정 Entitiy만 다루는 Component와 UI를 다루는 Component는 분리되어 있나요?

  • 데이터 흐름에 맞는 계층구조를 이루고 의존성이 맞게 작성이 되었나요?

리뷰 받고 싶은 내용

궁금한 점

과제를 수행하면서 느낀점

과제 시작 전 생각

과제 제출 후 생각

기타

과제 난이도

hyunjin.noh added 30 commits October 21, 2024 20:58
 - 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라는 명확한 명으로 수정
 - CartItem.tsx -> 장바구니 내역
 - Products.tsx -> 상품 리스트
 - Button.tsx -> 버튼
 - TextInput.tsx -> input
 - useEffect로 제품 수정 상태일 때 비정상 값으로 저장되지 않도록 버튼 disable 기능 추가
 - hooks/utils에서 /utils로
 - DiscountType enum 타입 추가
 - 테스트 코드와 물려있어 value를 대문자로 설정 불가.
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