You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
I have using kovenant framework with some questions
I would like to fetch a table of contents and fetch the content of the table
simultaneously, then output a mixed list with table content title and content itself.
But I faced the problems for coding with kovenant.
For example, I have MySubject and MySubjectDetails class.
class MySubject {
var id: String = ""
var name: String = ""
}
class MySubjectDetails {
var id: String = ""
var name: String = ""
var data: List<String> = ArrayList()
}
and APICalls class (part of code is pseudo code),
object APICalls {
fun getSubjects(): Promise<List<MySubject>, Exception> {
val deferred = deferred<List<MySubject>, Exception>()
// ... API calls ...
return deferred.promise
}
fun getSubjectById(id: String): Promise<MySubjectDetail, Exception> {
val deferred = deferred<MySubjectDetail, Exception>()
// ... API calls ...
return deferred.promise
}
}
I will get a result with Promise<List<MySubjectDetail>, Exception> type then I can't continue the code.
I expected it will be a combined list (List<MySubjectDetail>) but it comes up a Promise<List<MySubjectDetail>, Exception> object thats confused me.
How can I do or fix the code? Thanks.
The text was updated successfully, but these errors were encountered:
j796160836
changed the title
Chaining with all()
Question about chaining with all()Apr 22, 2019
Hi all,
I have using
kovenant
framework with some questionsI would like to fetch a table of contents and fetch the content of the table
simultaneously, then output a mixed list with table content title and content itself.
But I faced the problems for coding with
kovenant
.For example, I have
MySubject
andMySubjectDetails
class.and
APICalls
class (part of code is pseudo code),I may fetch the data like is:
I will get a result with
Promise<List<MySubjectDetail>, Exception>
type then I can't continue the code.I expected it will be a combined list (
List<MySubjectDetail>
) but it comes up aPromise<List<MySubjectDetail>, Exception>
object thats confused me.How can I do or fix the code? Thanks.
The text was updated successfully, but these errors were encountered: