Skip to content
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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

[REFACTOR] 7차 과제 완료 #12

wants to merge 7 commits into from

Conversation

MinseoSONG
Copy link
Contributor

Related issue 🛠

Work Description ✏️

  • MVI 패턴 적용

Screenshot 📸

이전 과제와 같습니다 !

Uncompleted Tasks 😅

To Reviewers 📢

처음 배우는 내용인데 시간이 없어서 급하게 하느라 많이 부족한 것 같아요 ..
여러분들의 리뷰로 많이 배우고 공부하고 리팩해보겠습니다 !!

Copy link

@Hyobeen-Park Hyobeen-Park left a 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 {

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의 함수로 구현하셔서 이유가 궁금합니다!!

Copy link
Contributor

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) {

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()

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()

Choose a reason for hiding this comment

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

요기도!!

Comment on lines +51 to +52
navController.navigate(Routes.SignIn.route) {
popUpTo(Routes.SignUp.route) { inclusive = true }

Choose a reason for hiding this comment

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

저는 navigator는 최대한 호이스팅해주려 하는 편입니다!! navigation 관련 로직은 screen에서보다는 navigator에서 해주는게 더 각각의 역할에 맞는 것 같아서요!!

Copy link
Contributor

Choose a reason for hiding this comment

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

동의합니다 ㅎ.ㅎ 합동 세미나 리뷰 (아마 당근이었나,,)에도 비슷한 내용을 적어놓은 부분이 있으니 이를 읽어보셔도 좋을 것 같아요.

Copy link

@wjdrjs00 wjdrjs00 left a comment

Choose a reason for hiding this comment

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

저번 주차 리뷰내용 반영하시면서 7주차 과제까지 하시느라 고생 많으셨습니다!!
확실히 mvi 패턴 어려워서 리뷰 남기기도 어려웠던거 같습니다,, 다시 공부좀 하고 오겠습니다,,!

Comment on lines +7 to +9
fun BaseResponse<ResponseLoginDto>.toDomain(): Token {
return Token(token = this.result.token)
}

Choose a reason for hiding this comment

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

이렇게도 가능합니다!(이미 아시겠지만 그래도 쇽 남겨보고싶었어요..ㅎ)

Suggested change
fun BaseResponse<ResponseLoginDto>.toDomain(): Token {
return Token(token = this.result.token)
}
fun BaseResponse<ResponseLoginDto>.toDomain(): Token =
Token(token = this.result.token)

Comment on lines +14 to +15
val response = hobbyRemoteDataSource.getMyHobby(token)
response.toDomain()

Choose a reason for hiding this comment

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

단순 response보단 hobby를 나타낼수 있는 네이밍을 사용하면 좀 더 명확한 전달이 가능하지 않을까? 하는 생각이 들었습니다!!

Copy link
Contributor

@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.

고생하셨습니다.

import org.sopt.and.data.remote.model.response.ResponseHobbyDto
import org.sopt.and.domain.model.Hobby

fun BaseResponse<ResponseHobbyDto>.toDomain(): Hobby {
Copy link
Contributor

Choose a reason for hiding this comment

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

저도 궁금하네요

Comment on lines +26 to +30
override suspend fun handleEvent(event: MyEvent) {
when (event) {
is MyEvent.LoadUserHobby -> {}
}
}
Copy link
Contributor

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 -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

스낵바와 관련된 sideEffect를 통해서 화면 전환까지 함께 이루어지고 있는 것 같은데요. 이를 분리해보셔도 좋을 것 같아요. 지금은 하나의 함수가 여러 책임을 가지고 있는 것 같네요.

Comment on lines +51 to +52
navController.navigate(Routes.SignIn.route) {
popUpTo(Routes.SignUp.route) { inclusive = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

동의합니다 ㅎ.ㅎ 합동 세미나 리뷰 (아마 당근이었나,,)에도 비슷한 내용을 적어놓은 부분이 있으니 이를 읽어보셔도 좋을 것 같아요.

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

Successfully merging this pull request may close these issues.

[REFACTOR] 7주차 과제
4 participants