fun getPost() = viewModelScope.launch {
_getPostLoading.value = true
_postDataList.value = PagingData.empty()
Pager(
config = PagingConfig(
pageSize = POST_SIZE,
enablePlaceholders = true
),
pagingSourceFactory = {
PostPagingSource(postRepository, tokenManager)
}
).flow.cachedIn(viewModelScope).collectLatest {
_postDataList.value = it
_getPostLoading.value = false
}
}
Is it possible to change the value received after paging?
For example, if you click Like on a post with the status PagingData, you can change the Like status of that post.