Skip to content

Conversation

@seungjae708
Copy link
Collaborator

🔍 관련 이슈

관련된 이슈 번호를 작성해주세요 (예: #123)
#10

💡 주요 변경사항

이번 PR에서 변경된 주요 내용을 작성해주세요

  • Coroutine 적용
  • Flow 적용

4주차 심화 과제였던 Open Api를 Coroutine과 Flow를 이용해서 구현했습니다!

📸 스크린샷

스크린샷
Screen_Recording_20251128_155835_dive.mp4

@seungjae708 seungjae708 self-assigned this Nov 28, 2025
@seungjae708 seungjae708 linked an issue Nov 28, 2025 that may be closed by this pull request
3 tasks
Copy link

@hyeminililo hyeminililo left a 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(

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 = "안드 어렵다..",

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(

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
}

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(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HomeScreen을 위 HomeRoute가 있기에, private를 적용할 수 있는걸까요 ??

Copy link

@Jyunee54 Jyunee54 left a 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,

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 -> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로딩 상태까지 대박이다!

Copy link

@seungjunGong seungjunGong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

허허 너무 잘하네요 오비해라 !!!

Comment on lines +58 to +68
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()
}
}
}

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>,

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 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요새 든 의문인데 이런 친구들 class 로 사용해야할까요 ?? interface 로 충분히 구현가능하지 않을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Week6] 6주차 과제

5 participants