-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Feat/#23] sign in #24
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.
음 ~ 아는 맛 최고
private val _tokenState = MutableSharedFlow<Boolean>(replay = 1) | ||
val tokenState: SharedFlow<Boolean> | ||
get() = _tokenState | ||
|
||
private val _userState = MutableSharedFlow<Boolean>() | ||
val userState: SharedFlow<Boolean> | ||
get() = _userState | ||
|
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 말고 Boolean 값을 활용하는 SharedFlow의 경우 변수명에 State를 안넣는 편이기는 합니다 ! 헷갈림 방지용이랄까
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.
오홍 그게 더 좋을 것 같네요!
Compose만 했더니 네이밍도 이제 헷갈리네요 하핳...
private fun observeUserState() { | ||
viewModel.userState.flowWithLifecycle(lifecycle).onEach { state -> | ||
navigateToScreenClear<OnboardingActivity>() | ||
if (state) { | ||
navigateToScreenClear<OnboardingActivity>() | ||
} else { | ||
toast(getString(R.string.error_msg)) | ||
} | ||
}.launchIn(lifecycleScope) | ||
} |
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.
이렇게 Boolean 값을 받아와서 if 문에 넣는 경우, state 대신 isBlank -> 같은 변수명을 사용해주는게 더 가독성이 좋을 것 같아요!
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.
아 복붙 딱들켰다 ㅋㅋ
⛳️ Work Description
📢 To Reviewers