Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 35e2721

Browse files
authored
Merge pull request #892 from eneim/feature/fix-ReceiveChannel-consumeAsFlow-can-be-collected-just-once
[Paging with Network] Fix consumeAsFlow can be collected just once
2 parents 882482b + 16c3efc commit 35e2721

File tree

1 file changed

+1
-1
lines changed
  • PagingWithNetworkSample/lib/src/main/java/com/android/example/paging/pagingwithnetwork/reddit/ui

1 file changed

+1
-1
lines changed

PagingWithNetworkSample/lib/src/main/java/com/android/example/paging/pagingwithnetwork/reddit/ui/SubRedditViewModel.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class SubRedditViewModel(
4646

4747
@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class)
4848
val posts = flowOf(
49-
clearListCh.consumeAsFlow().map { PagingData.empty<RedditPost>() },
49+
clearListCh.receiveAsFlow().map { PagingData.empty<RedditPost>() },
5050
savedStateHandle.getLiveData<String>(KEY_SUBREDDIT)
5151
.asFlow()
5252
.flatMapLatest { repository.postsOfSubreddit(it, 30) }

0 commit comments

Comments
 (0)