-
Notifications
You must be signed in to change notification settings - Fork 0
[Week6] 6주차 과제 #11
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
base: main
Are you sure you want to change the base?
[Week6] 6주차 과제 #11
Conversation
hyeminililo
left a comment
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.
코드가 전체적으로 정말 읽기 쉬웠어요! 컴포즈가 아직 어렵게 느껴지는 저도 흐름을 금방 이해할 수 있었습니다 😄 세미나에서 배운 내용들도 바로 적용하시다니 역시 잘하시네요 👍 과제 정말 고생 많으셨어요 🙌
| import com.sopt.dive.data.model.toModel | ||
| import com.sopt.dive.data.repository.OpenApiRepository | ||
|
|
||
| class OpenApiRepositoryImpl( |
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.
이번 세미나에서 배운 Impl까지 벌써 활용하셨네요 !! 🤩
|
|
||
| private val myProfileData = MyProfile( | ||
| name = "최승재", | ||
| statusMessage = "안드 어렵다..", |
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.
나도 ,,,
| ) { | ||
| Image( | ||
| painter = painterResource(id = friend.profileImageRes), | ||
| AsyncImage( |
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.
이건 기존 Image와 차이점이 있나요 ??
|
|
||
| sealed interface SignUpSideEffect { | ||
| data class ShowToast(val msg: String) : SignUpSideEffect | ||
| } |
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.
전체적으로 EOL 신경써주시면 이 빨간 원형을 없앨 수 있을 것 같아요 !! :)
| } | ||
|
|
||
| @Composable | ||
| private fun HomeScreen( |
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.
HomeScreen을 위 HomeRoute가 있기에, private를 적용할 수 있는걸까요 ??
Jyunee54
left a comment
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.
아니 너무 잘햇다!!!! 머야!!!
| class ViewModelFactory( | ||
| private val authRepository: AuthRepository, | ||
| private val userRepository: UserRepository, | ||
| private val openApiRepository: OpenApiRepository, |
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.
현재 구조에서는 Factory를 만들 때 모든 Repository를 인자로 넘겨줘야 해서, 특정 뷰모델에 불필요한 의존성까지 명시해야 하는 것 같아요
혹시 RepositoryModule을 통해 필요한 Repository만 가져오지 않고, Factory 생성자로 전부 주입받도록 구현하신 특별한 이유가 있을까요???
| modifier = modifier | ||
| ) | ||
| } | ||
| 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.
로딩 상태까지 대박이다!
seungjunGong
left a comment
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.
허허 너무 잘하네요 오비해라 !!!
| val uiState by viewModel.uiState.collectAsStateWithLifecycle() | ||
|
|
||
| LaunchedEffect(Unit) { | ||
| viewModel.sideEffect.flowWithLifecycle(lifecycleOwner.lifecycle) | ||
| .collect { sideEffect -> | ||
| when (sideEffect) { | ||
| is HomeSideEffect.ShowToast -> { | ||
| Toast.makeText(context, sideEffect.msg, Toast.LENGTH_SHORT).show() | ||
| } | ||
| } | ||
| } |
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.
좋네요 ㅎ.ㅎ 최고최고
| paddingValues: PaddingValues, | ||
| myProfile: MyProfile, | ||
| friendList: List<Friend>, | ||
| friendList: List<FriendUiModel>, |
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.
List 대신 ImmutableList를 사용해서 컬렉션을 불변으로 유지해주면 더 좋습니다 ㅎ
Compose에서 ImmutableList는 안정적인 타입으로 인식돼서 불필요한 리컴포지션을 줄이고 스마트 리컴포지션에도 도움이 돼요 !!!!!!
| import com.sopt.dive.data.model.FriendModel | ||
|
|
||
| @Immutable | ||
| sealed class FriendAction { |
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.
요새 든 의문인데 이런 친구들 class 로 사용해야할까요 ?? interface 로 충분히 구현가능하지 않을까요?
🔍 관련 이슈
관련된 이슈 번호를 작성해주세요 (예: #123)
#10
💡 주요 변경사항
이번 PR에서 변경된 주요 내용을 작성해주세요
4주차 심화 과제였던 Open Api를 Coroutine과 Flow를 이용해서 구현했습니다!
📸 스크린샷
Screen_Recording_20251128_155835_dive.mp4