-
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
[Feature] 프로필 생성 기능 제작 #62
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.
굿굿 상태 관리 빡셌을텐데 고생하셨습니다!! 👍 👍
comment 한 번 봐주세욥
엄청 크리티컬한 부분은 아니 생각되어 바로 머지하셔도 괜찮�아유~
LaunchedEffect(Unit) { | ||
viewModel.event.collect { event -> | ||
when (event) { | ||
is CreateProfileEvent.NavigateToHome -> { | ||
onNavigateToHome() | ||
} | ||
is CreateProfileEvent.ShowError -> { | ||
// @Gun Hyung TODO : 에러 메시지 호출 | ||
} | ||
} | ||
} | ||
} |
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.
이렇게 하게될 경우 사용자가 Home 버튼을 누르고 나갈 때도 Event 를 collect()하게 될 것 같아!
따라서, .collectAsStateWithLifecycle() 를 사용하는게 좋을 거 같습니당
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()를 사용했어!
만일 서버 요청 상태가 오래 지속되는 작업이라면 sharedFlow를 사용하지않으면서 .collectAsStateWithLifecycle()를 사용했을것 같아.
거기다 현재 Event를 SharedFlow로 정의해놓아서 .collectAsStateWithLifecycle()를 사용하게되면 현재 초기값을 넣어주어야 하는것으로 알고있는데 그러면 Event를 정의할 때 'None' 상태를 하나 추가해두어야 하는걸까?
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()를 사용했어!
만일 서버 요청 상태가 오래 지속되는 작업이라면 sharedFlow를 사용하지않으면서 .collectAsStateWithLifecycle()를 사용했을것 같아.
이런 이유라면 지금 로직 찬성입니다~ (뭔가 이런 의도일거라 생각해서 머지해도 찬성함 ㅋㅋㅋ😁)
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.
결론)지금 로직 좋습니당 머지고고~
관련 이슈
작업한 내용
Screen_recording_20240214_004615.mp4
PR 포인트
🚀Next Feature