diff --git a/app/src/main/kotlin/org/imaginativeworld/whynotcompose/ui/screens/tutorial/datafetchandpaging/DataFetchAndPagingViewModel.kt b/app/src/main/kotlin/org/imaginativeworld/whynotcompose/ui/screens/tutorial/datafetchandpaging/DataFetchAndPagingViewModel.kt index f6065c7..288b2a6 100644 --- a/app/src/main/kotlin/org/imaginativeworld/whynotcompose/ui/screens/tutorial/datafetchandpaging/DataFetchAndPagingViewModel.kt +++ b/app/src/main/kotlin/org/imaginativeworld/whynotcompose/ui/screens/tutorial/datafetchandpaging/DataFetchAndPagingViewModel.kt @@ -42,7 +42,7 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.emptyFlow @@ -65,8 +65,7 @@ class DataFetchAndPagingViewModel @Inject constructor( // ---------------------------------------------------------------- private val _state = MutableStateFlow(ListViewState()) - val state: StateFlow - get() = _state + val state = _state.asStateFlow() // ----------------------------------------------------------------