I have a function in repository that calls three APIs which return three different type of Objects.
fun scanSource(code: String) =
firstApi.DataV11Get(code)
.flatMap {
firstApi.sccGet(it.sscc)
}
.flatMap {
lastApi.lsccGet(it.id)
}
currently it is only returning the result of last API in the ViewModel .Now I want to have result of all of these in viewmodel.
plus the api must be sequential as they are using the data from the last API.
Also each API returns a different Object type.And I want all of three objects once all three calls are finished.
Thanks