From 16c3efce970dfb80af63ff0b18e0a311339e616d Mon Sep 17 00:00:00 2001 From: eneim <1776230+eneim@users.noreply.github.com> Date: Mon, 17 Aug 2020 14:02:24 +0900 Subject: [PATCH] Use receiveAsFlow() instead. --- .../paging/pagingwithnetwork/reddit/ui/SubRedditViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PagingWithNetworkSample/lib/src/main/java/com/android/example/paging/pagingwithnetwork/reddit/ui/SubRedditViewModel.kt b/PagingWithNetworkSample/lib/src/main/java/com/android/example/paging/pagingwithnetwork/reddit/ui/SubRedditViewModel.kt index 52f896893..0179cbc03 100644 --- a/PagingWithNetworkSample/lib/src/main/java/com/android/example/paging/pagingwithnetwork/reddit/ui/SubRedditViewModel.kt +++ b/PagingWithNetworkSample/lib/src/main/java/com/android/example/paging/pagingwithnetwork/reddit/ui/SubRedditViewModel.kt @@ -46,7 +46,7 @@ class SubRedditViewModel( @OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class) val posts = flowOf( - clearListCh.consumeAsFlow().map { PagingData.empty() }, + clearListCh.receiveAsFlow().map { PagingData.empty() }, savedStateHandle.getLiveData(KEY_SUBREDDIT) .asFlow() .flatMapLatest { repository.postsOfSubreddit(it, 30) }