-
Notifications
You must be signed in to change notification settings - Fork 0
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] 7차 과제 완료 #12
base: develop
Are you sure you want to change the base?
Conversation
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 적용도 너무 잘하셨네요!! 시험기간이라 바쁘셨을텐데 정말 수고 많으셨습니다!!
import org.sopt.and.data.remote.model.response.ResponseHobbyDto | ||
import org.sopt.and.domain.model.Hobby | ||
|
||
fun BaseResponse<ResponseHobbyDto>.toDomain(): Hobby { |
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.
저는 해당 mapper 함수는 BaseResponse보다는 데이터레이어의 엔티티를 도메인 엔티티로 변환하는 mapper라고 생각해서 dto의 확장함수로 만들었어요!! 민서님은 BaseReponse의 함수로 구현하셔서 이유가 궁금합니다!!
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.
저도 궁금하네요
_uiState.value = _uiState.value.reducer() | ||
} | ||
|
||
protected fun setSideEffect(builder: () -> SideEffect) { |
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.
오호 builder의 무엇인지!! 역할이 무엇인지 궁금해요!!
data class UserIdChanged(val userId: String) : SignUpEvent() | ||
data class UserPasswordChanged(val userPassword: String) : SignUpEvent() | ||
data class UserHobbyChanged(val userHobby: String) : SignUpEvent() | ||
object SignUpClicked : SignUpEvent() |
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.
오잉? 이 친구만 object네요!! data object가 아닌 그냥 object 사용하신 이유가 궁금해요!
|
||
sealed class SignUpSideEffect : UiSideEffect { | ||
data class ShowToast(val message: String) : SignUpSideEffect() | ||
object NavigateToSignIn : SignUpSideEffect() |
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.
요기도!!
navController.navigate(Routes.SignIn.route) { | ||
popUpTo(Routes.SignUp.route) { inclusive = true } |
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는 최대한 호이스팅해주려 하는 편입니다!! navigation 관련 로직은 screen에서보다는 navigator에서 해주는게 더 각각의 역할에 맞는 것 같아서요!!
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.
저번 주차 리뷰내용 반영하시면서 7주차 과제까지 하시느라 고생 많으셨습니다!!
확실히 mvi 패턴 어려워서 리뷰 남기기도 어려웠던거 같습니다,, 다시 공부좀 하고 오겠습니다,,!
fun BaseResponse<ResponseLoginDto>.toDomain(): Token { | ||
return Token(token = this.result.token) | ||
} |
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.
이렇게도 가능합니다!(이미 아시겠지만 그래도 쇽 남겨보고싶었어요..ㅎ)
fun BaseResponse<ResponseLoginDto>.toDomain(): Token { | |
return Token(token = this.result.token) | |
} | |
fun BaseResponse<ResponseLoginDto>.toDomain(): Token = | |
Token(token = this.result.token) |
val response = hobbyRemoteDataSource.getMyHobby(token) | ||
response.toDomain() |
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.
단순 response보단 hobby를 나타낼수 있는 네이밍을 사용하면 좀 더 명확한 전달이 가능하지 않을까? 하는 생각이 들었습니다!!
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.
고생하셨습니다.
import org.sopt.and.data.remote.model.response.ResponseHobbyDto | ||
import org.sopt.and.domain.model.Hobby | ||
|
||
fun BaseResponse<ResponseHobbyDto>.toDomain(): Hobby { |
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.
저도 궁금하네요
override suspend fun handleEvent(event: MyEvent) { | ||
when (event) { | ||
is MyEvent.LoadUserHobby -> {} | ||
} | ||
} |
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.
이 함수에 어떤 것들을 담을지 고민해보시고 이를 바탕으로 로직을 수정해보시면 좋을 것 같아요.
LaunchedEffect(Unit) { | ||
signInViewModel.sideEffect.collectLatest { sideEffect -> | ||
when (sideEffect) { | ||
is SignInSideEffect.ShowSnackBar -> { |
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.
스낵바와 관련된 sideEffect를 통해서 화면 전환까지 함께 이루어지고 있는 것 같은데요. 이를 분리해보셔도 좋을 것 같아요. 지금은 하나의 함수가 여러 책임을 가지고 있는 것 같네요.
navController.navigate(Routes.SignIn.route) { | ||
popUpTo(Routes.SignUp.route) { inclusive = true } |
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.
동의합니다 ㅎ.ㅎ 합동 세미나 리뷰 (아마 당근이었나,,)에도 비슷한 내용을 적어놓은 부분이 있으니 이를 읽어보셔도 좋을 것 같아요.
Related issue 🛠
Work Description ✏️
Screenshot 📸
이전 과제와 같습니다 !
Uncompleted Tasks 😅
To Reviewers 📢
처음 배우는 내용인데 시간이 없어서 급하게 하느라 많이 부족한 것 같아요 ..
여러분들의 리뷰로 많이 배우고 공부하고 리팩해보겠습니다 !!