Office Hours Transcript: 2021-06-12
Ivano_ndrocchietto joined
hello, Ivano!
how can I help you today?
heila Mark, I have a question rearding this invoke in the alphabet documentation https://developer.android.com/kotlin/coroutines/coroutines-best-practices#main-safe
when this invoke is invoked?
I do not think that is shown in their sample
ndrocchietto_beta joined
these sorts of in-page Google code snippets usually are incomplete
in this case, GetLatestNewsWithAuthorsUseCase
is using NewsRepository
, but there is nothing in the snippet showing the use of GetLatestNewsWithAuthorsUseCase
itself
I see that but why to put invoke in a suspend function, should not be invoke something that is called under the hood a kind of init
?
I cannot tell you why they decided to put this logic in an invoke()
function implementation
I mean, it does not even compile – invoke()
is supposed to return List<ArticleWithAuthor>
, and the return
statement is returning a Result.Success
object
yes that is why i am flabbergasted
documentation bugs are commonplace, particularly with these code snippets
I used to file a bunch of issues in the issue tracker to try to get them fixed, but those issues usually were ignored
good to know, I was thinking documentation were bulletproof
far from it
but I signaled typos more than once
well wish you a nice afternoon
and see you next time, thanks
!changecolor
bye Mark
have a pleasant evening!
thanks
you too
Ivano_ndrocchietto left
ndrocchietto_beta left