Closed periva101 closed 2 years ago
@VictorKabata @MartinMugambi @Kagiri11
@periva101 this is no secret behind it. It's just that we want to expose a flow of MovieDetails from the repo layer.
@periva101 This will make it easier to add caching later. I'm expecting whatever caching lib we decide to use will return Flow<List<Movies>>
that is why we are using flowOf()
though It has no "real" functional use at the moment.
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
suspend fun fetchMovieDetails(movieId: Int): MovieDetailsDto?
why are MovieDetailsRepositoryImpl methods had converted to
flowOf ()
e.gwhat 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 usecases.
I see this pattern I would like to know the secret behind 😎