The following interface fetches articles for an id.
interface NetworkApi {
/*
* Fetches details of an article of parameter [id] from the network.
*/
fun article(id: String) : Single<Article>
}
The UI needs to show a list of ArticleUi
.
class ArticleUi constructor(article: Article) {
// implementation
}
fun getArticleUi(val ids: List<String>) : Observable<List<ArticleUi>>{
// your solution.
}
Sample input:
val ids = listOf("id1", "id2", "id3", "id4")