-
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/week8] clean architecture #12
Conversation
λλ ν 리 [data-datasourceimpl-remote]
β¦oAndroidViewModel μ΄κΈ°ν
[chore] : rename
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 const val AUTH_BASE_URL = BuildConfig.AUTH_BASE_URL | ||
private const val USER_BASE_URL = BuildConfig.USER_BASE_URL |
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.
λ€μ΄λ°μ΄ λκ°μλ° λ³μλ₯Ό μ μΈν΄μ€ μ΄μ κ° μμκΉμ??
override suspend fun getReqresList(page: Int): ResponseReqresDto { | ||
return reqresService.getUserList(page) | ||
} |
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.
override suspend fun getReqresList(page: Int): ResponseReqresDto { | |
return reqresService.getUserList(page) | |
} | |
override suspend fun getReqresList(page: Int): ResponseReqresDto = reqresService.getUserList(page) | |
μκΈ°λ μμλ ν΅μΌμ± μκ²!
is LoginState.Error -> toast("λ‘κ·ΈμΈ μ€ν¨") | ||
is LoginState.Loading -> toast("λ‘κ·ΈμΈ μ€") | ||
is UiState.Error -> toast("λ‘κ·ΈμΈ μ€ν¨") | ||
is UiState.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.
is UiState.Loading -> {} | |
is UiState.Loading -> Unit |
μλ κ²λ μμ± κ°λ₯!
Log.d("server", it.code().toString()) | ||
authRepository.login(UserRequestEntity(id, password)) | ||
.onSuccess { | ||
_loginState.emit(UiState.Success(it)) |
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.
viewModelμμ λ°μ΄ν°λ₯Ό μμ°(emit)ν΄μ£Όμ μ΄μ κ° μμκΉμ?!
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 fun observeSignUpState(userEntity: User) { | ||
private fun observeSignUpState() { | ||
lifecycleScope.launch { | ||
viewModel.signUpState.collect { |
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.
κ·Έλ¦¬κ³ flowWithLifecycleμ λν΄μ 곡λΆν΄λ³΄λ©΄ μ’μ κ² κ°μμ!
(ννΈλ StateFlowλ lifecycleμ μλμΌλ‘ μ²λ¦¬νμ§ μμμ μλμΌλ‘ flowμ collect μ€μ§μμΌμ£Όμ΄μΌν΄μ!)
ν΄λ¦°μν€ν
μ³ μ 볡μ΅νκ³ κ°λλ€μ~~! νμ΄ν
~! |
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.
μΆνμ ν΄λ¦° μν€ν μ³ κ³΅λΆν λ μ½λ λ³΄κ² μ΅λλ€ LGTM
πππ΄π΄πΆπ¦π΄
πππ°π³π¬ ππ¦π΄π€π³πͺπ±π΅πͺπ°π―
π·ππ€π³π¦π¦π―π΄π©π°π΅
π¬ππ° ππ¦π·πͺπ¦πΈπ¦π³π΄
μνμ μ΄λ €μ€