有人可以帮忙吗?
我有这些功能
fun getBooks(): Single<List<Book>> {
return getCollections()
.map {
it.map(::collectonToBook)
}
}
fun getCollections(): Single<List<Collection>> {
return db.fetchCollections()
.filter(::isBook)
}
fun collectonToBook(collection: Collection): Maybe<Book> {
return collection.toBook()
}
Run Code Online (Sandbox Code Playgroud)
问题是 getBooksSingle<List<Maybe<Book>>>在我需要时返回Single<List<Book>>。我可以在流中执行此操作而不调用blockingGet吗?