Replies: 2 comments 1 reply
-
I'm moving this question to Discussions because it makes more sense to be here instead of Issues. First, when you make HTTP requests to an API, these are one-shot read / write operations. It is not about observing a data stream in a reactive way. This is why when you define the skeleton of your API calls you do so using coroutines, and in your repository you use suspend functions. Here, there's more info about this: https://developer.android.com/topic/architecture/data-layer#expose-apis |
Beta Was this translation helpful? Give feedback.
-
I want to thank you first,
then I hope you answer my question, it is a question, not an issue 😃
All ApiService methods are returning suspend functions
operator fun invoke(dadJoke: DadJoke, favored: Boolean): Flow<Boolean>
why are FavorDadJokeInteractor methods converted to
flowOf ()
e.g
what are the benefits of making all repo methods in kotlin flow,
where consuming suspend fun is easier than flow?
also combing two suspend funs is much easier to combine two flows to create new use cases.
I see this pattern I would like to know the secret behind 😎
Beta Was this translation helpful? Give feedback.
All reactions