Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

215
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda