-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor: 필수 질문을 모두 확인하도록 수정 #142
Conversation
- useSendAppliction -> useApplication - canNext -> canApplicationNext(in useApplication) - remove when no data in getApplicationValues
switch (name) { | ||
case "personalInformationAgreeForPortfolio": | ||
case "personalInformationAgree": | ||
return localStorageValueFromName !== "동의합니다." | ||
? "personalInformationAgree" | ||
: ""; | ||
case "email": | ||
return !isEmail(localStorageValueFromName) ? "email" : ""; | ||
case "check": | ||
return localStorageValueFromName !== "확인했습니다" ? "check" : ""; | ||
case "channel": | ||
return localStorageValueFromName.length === 0 && | ||
localStorage.get("channelEtc", EMPTY_STRING).length === 0 | ||
? "channel" | ||
: ""; | ||
default: | ||
return localStorageValueFromName.length === 0 ? name : ""; | ||
} | ||
}) | ||
.filter((name) => name.length !== 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
먼가 좀 더 좋은 방법이 없을가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
함수형을 공부하고 다시 와보죠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 잘 짜여졌다고 생각합니다 아직 제가 이해하기는 조금 어렵지만!!
그리고 useApplication
함수가 좀 길어진 것 같은데 어떻게 분리할 방안이 없을까요??..
너무 수고많으셨습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다
흑흑
switch (name) { | ||
case "personalInformationAgreeForPortfolio": | ||
case "personalInformationAgree": | ||
return localStorageValueFromName !== "동의합니다." | ||
? "personalInformationAgree" | ||
: ""; | ||
case "email": | ||
return !isEmail(localStorageValueFromName) ? "email" : ""; | ||
case "check": | ||
return localStorageValueFromName !== "확인했습니다" ? "check" : ""; | ||
case "channel": | ||
return localStorageValueFromName.length === 0 && | ||
localStorage.get("channelEtc", EMPTY_STRING).length === 0 | ||
? "channel" | ||
: ""; | ||
default: | ||
return localStorageValueFromName.length === 0 ? name : ""; | ||
} | ||
}) | ||
.filter((name) => name.length !== 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
함수형을 공부하고 다시 와보죠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와.. 길다
사실 보내는 함수쪽이 좀 긴거 같아요..... 여기서 몇개 빼서 순수함수처럼 만들 수 있으니 그걸 활용해야겠어요 |
일단 오늘 내로 처리해야하는 문제라 닫겠습니다. 추후 리뷰 해주시면, 다시 열어서 고치겠습니다! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다! 👍
훅으로 뽑아내니까 컴포넌트가 깔끔해진 것 같아요!
useApplication 훅 내에 복잡한 로직들을 함수로 뽑아내서 이름을 붙이면 조금 더 흐름을 파악하는데 도움이 될 것 같습니다.
주요 변경사항
리뷰어에게...
관련 이슈