Skip to content

Commit

Permalink
Merge pull request #892 from eneim/feature/fix-ReceiveChannel-consume…
Browse files Browse the repository at this point in the history
…AsFlow-can-be-collected-just-once

[Paging with Network] Fix consumeAsFlow can be collected just once
  • Loading branch information
dlam authored Aug 18, 2020
2 parents 882482b + 16c3efc commit 35e2721
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SubRedditViewModel(

@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class)
val posts = flowOf(
clearListCh.consumeAsFlow().map { PagingData.empty<RedditPost>() },
clearListCh.receiveAsFlow().map { PagingData.empty<RedditPost>() },
savedStateHandle.getLiveData<String>(KEY_SUBREDDIT)
.asFlow()
.flatMapLatest { repository.postsOfSubreddit(it, 30) }
Expand Down

0 comments on commit 35e2721

Please sign in to comment.