-
Notifications
You must be signed in to change notification settings - Fork 0
[Refactor] Week7 필수 과제 #13
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
base: develop
Are you sure you want to change the base?
Conversation
yskim6772
left a comment
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.
고생하셨습니다 !
조금 더 MVI 패턴에 가까운 코드를 작성하기 위해,
SideEffect와 Event를 고려하여, 리팩토링 해보면 좋을 것 같아요 !
| fun handleErrorToast( | ||
| exception: Throwable?, | ||
| is400Error: Int, | ||
| context: Context, | ||
| is403Error: Int = R.string.fail_to_network, | ||
| is409Error: Int = R.string.fail_to_network, | ||
| ) { | ||
| return when (exception) { | ||
| is HttpException -> when (exception.code()) { | ||
| 400 -> context.toast(context.getString(is400Error)) | ||
| 403 -> context.toast(context.getString(is403Error)) | ||
| 409 -> context.toast(context.getString(is409Error)) | ||
| else -> context.toast(context.getString(R.string.fail_to_network)) | ||
| } | ||
|
|
||
| is IOException -> { | ||
| context.toast(context.getString(R.string.fail_to_network)) | ||
| } | ||
|
|
||
| else -> { | ||
| context.toast(context.getString(R.string.fail_to_login)) | ||
| } | ||
| } | ||
| } No newline at end of file |
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.
오옹 따로 handleErrorToast 함수 만들어놓은 것 좋네요 ! 혹시 이 에러 핸들링이 login 서버통신에만 적용되는 거라면, 어디서 사용되는건지 명시해주면 좋을 것 같아요 !
| fun NavController.navigateToSignUp() { | ||
| navigate(Routes.SignUp.screen) | ||
| } | ||
|
|
||
| fun NavController.navigateToLogin() { | ||
| navigate(Routes.Login.screen) | ||
| } No newline at end of file |
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.
위 두 navigator를 같이 묶어두신 이유가 있을까요?!
| editorDummy: List<TodayTopData>, | ||
| top20Dummy: List<TodayTopData>, | ||
| scrollState: ScrollState = rememberScrollState(), | ||
| pagerState: PagerState = rememberPagerState(pageCount = { 6 }) |
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.
여기서도 상수화 진행해줍시다 ~
jihyunniiii
left a comment
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.
고생하셨습니다
| @@ -0,0 +1,24 @@ | |||
| package org.sopt.and.domain.type | |||
|
|
|||
| enum class HomeTabType( | |||
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.
domain에 위치시키신 이유가 궁금해요!
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.
요 부분은 mvi가 아직 적용되지 않은 걸로 보이는데 맞나요?
Related issue 🛠
Work Description ✏️
Screenshot 📸
저번과 동일합니다.
Uncompleted Tasks 😅
To Reviewers 📢
mvi 패턴을 깔끔하게 적용하지 못한 것 같아요... 따끔한 피드백 부탁드립니다!