Skip to content

My Page Bookmark #590

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

Merged
merged 8 commits into from
Oct 29, 2024
Merged

My Page Bookmark #590

merged 8 commits into from
Oct 29, 2024

Conversation

yuni-ju
Copy link
Member

@yuni-ju yuni-ju commented Oct 27, 2024

작업 내용

1. 북마크 화면 생성

2. 북마크 상태 관리

  • BookmarkViewModel 분리
  • BookmarkUiState로 화면 상태 관리
  • 북마크 목록을 페이징으로 불러오기
data class BookmarkUiState(
    val count: Int = 0,
    val bookmarks: Flow<PagingData<BookmarkPost>> = flow { emit(PagingData.empty()) },
    val isEditMode: Boolean = false,
    val selectedBookmarks: Set<Int> = emptySet()
)

3. 북마크 삭제

  • 편집 상태 여부에 따라 화면 구현
  • 삭제를 위해 선택한 글은 Set에 postId를 넣어서 관리
  • 삭제 버튼 클릭 시 requestDeleteBookmarkPostUseCaseasync로 동시에 실행하고,
    awaitAll으로 모든 삭제 작업이 끝난 후 상태 업데이트

참고 사항

  1. 회의 내용에 따라 사용하지 않는 Fragment 삭제
  2. DayoCheckbox의 이름으로 CustomCheckbox 구현

실행 화면

북마크 리스트 북마크 여러개 삭제
image image

resolved: #587

@yuni-ju yuni-ju requested a review from DongJun-H October 27, 2024 15:31
@yuni-ju yuni-ju self-assigned this Oct 27, 2024
Copy link
Member

@DongJun-H DongJun-H left a comment

Choose a reason for hiding this comment

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

분리 하시느라 수고하셨습니다 👍
앞으로 마이그레이션할때도 UiState로 다 관리하도록 하는것으로 해볼까요

@yuni-ju
Copy link
Member Author

yuni-ju commented Oct 29, 2024

@DongJun-H

앞으로 마이그레이션할때도 UiState로 다 관리하도록 하는것으로 해볼까요

Compose는 UI State를 Composable을 통해 화면에 정의하는 과정이므로,
하나의 UiState를 두면 현재 화면의 상태가 하나의 객체에 캡슐화되어서 코드 상 명확하다는 장점이 있습니다.
이 코드에서는 북마크의 편집 상태 관리를 묶어서 표시하기 용이했습니다.

하지만 리컴포지션이 자주 일어날 수 있다는 단점이 있을 것 같아요.

만약 다 UiState로 관리하기로 결정한다면 domain의 모듈 영역에 data class를 두는 것이 좋을지도 고민입니다!

낼 회의에서 논의해봅시다 😎

@yuni-ju yuni-ju merged commit 2b42c73 into develop Oct 29, 2024
1 check passed
@yuni-ju yuni-ju deleted the feature/issue-587 branch October 29, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[feature] My Page Bookmark
2 participants