79445211

Date: 2025-02-17 11:16:18
Score: 0.5
Natty:
Report link

Observable.from() can be used. It will convert a list into observable sequence of individual element. After all the operations use .toArray() at the last which will again convert it into sequence of list.

func fetchGameDetailModelList(pageNo: Int) -> Observable<[GameDetailModel]> {
    fetchAllGamesWithPagination(pageNo)
        .flatMapLatest { listGames in
            Observable.from(listGames)
                .flatMap { fetchGameDetails($0.id) }
                .toArray()
        }
    }
}

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): can
  • Low reputation (0.5):
Posted by: Pranav Pravakar