-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feature] OnBoardingDestination 만들기 #13
Conversation
sealed interface LoginOnBoardingEvent { | ||
data object OnClickNextStep : LoginOnBoardingEvent | ||
|
||
sealed interface Loading : LoginOnBoardingEvent { | ||
data object Success : Loading | ||
data class Failure(val exception: ServerException) : Loading | ||
data class Error(val exception: Throwable) : Loading | ||
} | ||
} |
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.
이벤트 개념을 제가 다시 설명드려야 될 것 같아요.
Event 는 ViewModel 에서 Screen 으로 notify 시킬 때 사용됩니다.
그런데 OnClickNextStep 은 intent 에 해당되는 내용이고, Loading 은 state 에 해당되는 내용입니다.
보통 API 통신 결과를 날려서 관련 액션을 Screen 쪽에서 하게 될텐데,
OnBoarding 은 딱히 API 통신이 없을 것 같아서, 적을 내용은 없어보여요.
사실, 온보딩 화면에서 쏠 이벤트는 딱히 없어보여서, 이 부분 UI 구현하실 때 수정해주셔도 괜찮으니 그때 같이 작업해주세요.
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.
옹 이부분 확인해보고 수정해보겠습니답
온보딩 과정에서 서버에서 이미지나 영상을 불러올 일이 없을까요??
혹시나 해서 작성을 해봤습니다
...in/ac/dnd/bookkeeping/android/presentation/ui/main/login/onboarding/LoginOnBoardingIntent.kt
Outdated
Show resolved
Hide resolved
LaunchedEffectWithLifecycle(event, handler) { | ||
event.collectLatest { event -> | ||
when (event.value) { | ||
is LoginOnBoardingEvent.OnClickNextStep -> { | ||
appState.navController.navigate(LoginMainConstant.ROUTE) { | ||
popUpTo(LoginOnBoardingConstant.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.
event 는 collect 로 하시면 안되고, eventObserve였나? 그거로 하셔야 됩니다.
consume 되지 않은 이벤트만 가져오게 하기 위함이에요.
아래 게시글 마지막부분 참고해주시면 이해가 더 잘 될 것 같아요
...ac/dnd/bookkeeping/android/presentation/ui/main/login/onboarding/LoginOnBoardingViewModel.kt
Outdated
Show resolved
Hide resolved
sealed interface Loading : LoginOnBoardingEvent { | ||
data object Success : Loading | ||
data class Failure(val exception: ServerException) : Loading | ||
data class Error(val exception: Throwable) : Loading | ||
} |
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.
State 는 Init Loading 으로 충분할 것 같아요. 이거 아마 실제 사용해보시면 감이 오실 것 같아요
나중에 제가 state, event, intent 사용하는 샘플코드를 하나 작성해서 보여드릴게요
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.
호옹 감사합니다
설명
수정 사항이 생길 것 같은데, 좀 더 개선해보겠습니다. !
참고
체크리스트