Conversation
sunnyinha
reviewed
Nov 28, 2025
|
|
||
| return { items: newItems, amount, total }; | ||
| }), | ||
|
|
Collaborator
There was a problem hiding this comment.
서로 코드에서는 immer 써서 불변성 지켰는데 치치는 새롭게 map, filter로 배열 생성해서 불변성을 지켰군요!
구현 방식이 다른 게 흥미롭네요!!
There was a problem hiding this comment.
맞아요. 새롭게 배열을 생성해서 불변성을 지켰다는 것이 인상 깊어요. 역시 코딩은 정답이 없고 다양한 방식으로 구현할 수 있다는 것이 재밌는 것 같아요..
wupe1001
reviewed
Nov 28, 2025
Comment on lines
+13
to
+30
| interface CartState { | ||
| items: CartItem[]; | ||
| amount: number; | ||
| total: number; | ||
| isOpen: boolean; | ||
| } | ||
|
|
||
| interface CartActions { | ||
| increase: (id: string) => void; | ||
| decrease: (id: string) => void; | ||
| removeItem: (id: string) => void; | ||
| clearCart: () => void; | ||
| calculateTotals: () => void; | ||
| openModal: () => void; | ||
| closeModal: () => void; | ||
| } | ||
|
|
||
| type CartStore = CartState & CartActions; |
There was a problem hiding this comment.
상태와 액션의 타입을 따로 정의하고 & 연산자로 두 타입을 합친 하나의 CartStore까지 정의할 수 있는 방법이 있었네요..! 이 방법은 정말 유용하게 쓰일 수 있을 것 같아요.
Collaborator
|
치치 이번 주 잘 작성하셔서 제가 따로 피드백 할 부분이 없네요!! LGTM~ |
Collaborator
|
치치 9주차도 열심히 해주셔서 감사합니다~! 머지해주세요! |
sunnyinha
approved these changes
Nov 30, 2025
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.
✅ 워크북 체크리스트
✅ 컨벤션 체크리스트
📌 주안점