Skip to content

Conversation

@gitsuhyun
Copy link
Contributor

Related issue 🛠

Work Description ✏️

  • 필수 과제
    • mvi 리팩토링

Screenshot 📸

저번과 동일합니다.

Uncompleted Tasks 😅

  • event, sideEffect 분리

To Reviewers 📢

mvi 패턴을 깔끔하게 적용하지 못한 것 같아요... 따끔한 피드백 부탁드립니다!

@gitsuhyun gitsuhyun added the enhancement New feature or request label Dec 17, 2024
@gitsuhyun gitsuhyun self-assigned this Dec 17, 2024
Copy link
Member

@yskim6772 yskim6772 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 !
조금 더 MVI 패턴에 가까운 코드를 작성하기 위해,
SideEffect와 Event를 고려하여, 리팩토링 해보면 좋을 것 같아요 ! ☺️

Comment on lines +8 to +31
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오옹 따로 handleErrorToast 함수 만들어놓은 것 좋네요 ! 혹시 이 에러 핸들링이 login 서버통신에만 적용되는 거라면, 어디서 사용되는건지 명시해주면 좋을 것 같아요 !

Comment on lines +5 to +11
fun NavController.navigateToSignUp() {
navigate(Routes.SignUp.screen)
}

fun NavController.navigateToLogin() {
navigate(Routes.Login.screen)
} No newline at end of file
Copy link
Member

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 })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서도 상수화 진행해줍시다 ~

Copy link

@jihyunniiii jihyunniiii left a 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(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

domain에 위치시키신 이유가 궁금해요!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요 부분은 mvi가 아직 적용되지 않은 걸로 보이는데 맞나요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] week7 필수 과제

4 participants