AndreiBogdan
07/06/2023, 2:10 PMclass SharedBookService {
private val bookRepository = BookRepository()
/**
* @return an array of book permanent ids
*/
fun getAssignedBooks(): SingleWrapper<List<String>> {
return singleFromCoroutine {
bookRepository.callAssignedBooks()
}
.subscribeOn(ioScheduler)
.observeOn(mainScheduler)
.onErrorReturn { t ->
Console.apiError.log("getAssignedBooks :: " + t.message)
listOf()
}
.wrap()
}
}
AndreiBogdan
07/06/2023, 2:10 PMCLOVIS
07/06/2023, 3:08 PMPromise
in JS