A fully functional Android app built entirely with Kotlin and Jetpack Compose
ForYouViewModel: replace snapshotFlow with flowOf
hoc08109851c7ea2fe431
diff --git a/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt b/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.ktindex c79c9d777..599bfd868 100644--- a/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt+++ b/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt@@ -16,7 +16,6 @@package com.google.samples.apps.nowinandroid.feature.foryou-import androidx.compose.runtime.snapshotFlowimport androidx.lifecycle.ViewModelimport androidx.lifecycle.viewModelScopeimport com.google.samples.apps.nowinandroid.core.data.repository.UserDataRepository@@ -33,6 +32,7 @@ import kotlinx.coroutines.flow.SharingStartedimport kotlinx.coroutines.flow.StateFlowimport kotlinx.coroutines.flow.combineimport kotlinx.coroutines.flow.flatMapLatest+import kotlinx.coroutines.flow.flowOfimport kotlinx.coroutines.flow.mapimport kotlinx.coroutines.flow.onStartimport kotlinx.coroutines.flow.stateIn@@ -67,7 +67,7 @@ class ForYouViewModel @Inject constructor(userData.followedAuthors.isEmpty() &&userData.followedTopics.isEmpty()) {- snapshotFlow { NewsFeedUiState.Success(emptyList()) }+ flowOf(NewsFeedUiState.Success(emptyList()))} else {getSaveableNewsResourcesStream(filterTopicIds = userData.followedTopics,