Skip to content

Commit 51c7ea2

Browse files
committed
ForYouViewModel: replace snapshotFlow with flowOf
1 parent 5286920 commit 51c7ea2

File tree

1 file changed

+2
-2
lines changed
  • feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou

1 file changed

+2
-2
lines changed

feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.samples.apps.nowinandroid.feature.foryou
1818

19-
import androidx.compose.runtime.snapshotFlow
2019
import androidx.lifecycle.ViewModel
2120
import androidx.lifecycle.viewModelScope
2221
import com.google.samples.apps.nowinandroid.core.data.repository.UserDataRepository
@@ -33,6 +32,7 @@ import kotlinx.coroutines.flow.SharingStarted
3332
import kotlinx.coroutines.flow.StateFlow
3433
import kotlinx.coroutines.flow.combine
3534
import kotlinx.coroutines.flow.flatMapLatest
35+
import kotlinx.coroutines.flow.flowOf
3636
import kotlinx.coroutines.flow.map
3737
import kotlinx.coroutines.flow.onStart
3838
import kotlinx.coroutines.flow.stateIn
@@ -67,7 +67,7 @@ class ForYouViewModel @Inject constructor(
6767
userData.followedAuthors.isEmpty() &&
6868
userData.followedTopics.isEmpty()
6969
) {
70-
snapshotFlow { NewsFeedUiState.Success(emptyList()) }
70+
flowOf(NewsFeedUiState.Success(emptyList()))
7171
} else {
7272
getSaveableNewsResourcesStream(
7373
filterTopicIds = userData.followedTopics,

0 commit comments

Comments
 (0)