-
Notifications
You must be signed in to change notification settings - Fork 1
[hotfix] user info #208
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
[hotfix] user info #208
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 확인해주세요!
import kotlinx.coroutines.flow.asStateFlow | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class LoginViewModel @Inject constructor( | ||
private val userLoginUseCase: UserLoginUseCase, | ||
) : BaseViewModel() { | ||
private val _loginState = MutableStateFlow<LoginState>(LoginState.Init) | ||
val loginState: StateFlow<LoginState> = _loginState.asStateFlow() | ||
private val _loginState = MutableSharedFlow<LoginState>() |
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.
단일성 이벤트를 위해서 변경한건가요?
https://medium.com/androiddevelopers/viewmodel-one-off-event-antipatterns-16a1da869b95
참고해보시면 좋을것 같네요
EventFlow를 만들어서 문제점을 개선할 수 있었습니다. 🗒️ 정리한 노션 : SharedFlow + EventFlow |
@yunjaena |
버그
로그아웃 & 회원탈퇴 SingleLiveEvent value NPE
=> SharedFlow 로 변경
LoginViewModel StateFlow -> SharedFlow