Skip to content

Commit

Permalink
Merge pull request #274 from easyhooon/main
Browse files Browse the repository at this point in the history
fix: flow 반환 타입 함수 suspend 키워드 제거
  • Loading branch information
taehwandev authored Apr 22, 2024
2 parents 77fef86 + e98576b commit 145abcb
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal class DefaultSessionRepository @Inject constructor(
?: error("Session not found with id: $sessionId")
}

override suspend fun getBookmarkedSessionIds(): Flow<Set<String>> {
override fun getBookmarkedSessionIds(): Flow<Set<String>> {
return bookmarkIds.filterNotNull()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface SessionRepository {

suspend fun getSession(sessionId: String): Session

suspend fun getBookmarkedSessionIds(): Flow<Set<String>>
fun getBookmarkedSessionIds(): Flow<Set<String>>

suspend fun bookmarkSession(sessionId: String, bookmark: Boolean)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class GetBookmarkedSessionIdsUseCase @Inject constructor(
private val sessionRepository: SessionRepository,
) {

suspend operator fun invoke(): Flow<Set<String>> {
operator fun invoke(): Flow<Set<String>> {
return sessionRepository.getBookmarkedSessionIds()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class GetBookmarkedSessionsUseCase @Inject constructor(
private val getBookmarkedSessionIdsUseCase: GetBookmarkedSessionIdsUseCase,
) {

suspend operator fun invoke(): Flow<List<Session>> =
operator fun invoke(): Flow<List<Session>> =
combine(
getSessionsUseCase(),
getBookmarkedSessionIdsUseCase()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import kotlinx.coroutines.flow.flow
class GetSessionsUseCase @Inject constructor(
private val sessionRepository: SessionRepository,
) {
suspend operator fun invoke(): Flow<List<Session>> {
operator fun invoke(): Flow<List<Session>> {
return flow {
emit(sessionRepository.getSessions())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal class FakeSessionRepository(
return sessions.first { it.id == sessionId }
}

override suspend fun getBookmarkedSessionIds(): Flow<Set<String>> {
override fun getBookmarkedSessionIds(): Flow<Set<String>> {
return flow { emit(bookmarkedSessionIds) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal class SessionViewModelTest {
@Test
fun `세션 데이터를 확인할 수 있다`() = runTest {
// given
coEvery { getSessionsUseCase() } returns listOf(fakeSession)
coEvery { getSessionsUseCase() } returns flowOf(listOf(fakeSession))
coEvery { getBookmarkedSessionIdsUseCase() } returns flowOf(emptySet())
viewModel = SessionViewModel(getSessionsUseCase, getBookmarkedSessionIdsUseCase)

Expand Down

0 comments on commit 145abcb

Please sign in to comment.