Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

222
Views
Combining 2 or more flow of Paging data

I'm making 2 parallel API calls to request for paging data. I need to combine the result of both API calls upon getting the result and submit the paging data to adapter.

viewLifecycleOwner.lifecycleScope.launchWhenStarted {
            val assignedList = async {
                assignedTaskViewModel.getPagingTasks(getAssignedTasks)
            }

            val unscheduledTasksList = async {
                assignedTaskViewModel.getUnscheduledChores(getUnscheduledTasks)
            }

            unscheduledTasksList.await().combine(assignedList.await()) { unschedule, assign ->
                Timber.d("combining 2 calls")
                //TODO need to show unscheduledTasksList first followed by assignedList
            }.collectLatest {
                it.map { value ->
                    Timber.d("paging data = $value")
                }
                assignedTasksPagingAdapter?.submitData(it)
            }
        }

is there a way to transform the pagingData so that i can combine the result from 2 API calls and submit to the adapter as single paging data?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!