Skip to content

Instantly share code, notes, and snippets.

@vikasmain
Created January 14, 2022 15:42
Show Gist options
  • Save vikasmain/f8d6ef79c206ebc659dc6b6fb6b830e3 to your computer and use it in GitHub Desktop.
Save vikasmain/f8d6ef79c206ebc659dc6b6fb6b830e3 to your computer and use it in GitHub Desktop.
@MovieActivityScope
class MovieModel @Inject constructor(
private val movieApi: MovieApi
) {
fun callMoviesApi(): Flow<MovieListResponse> {
return flow {
val carbonOffsetResponse = movieApi.getMoviesList("a427cfb730b4a73e67c646d8b44dd216")
emit(carbonOffsetResponse)
}.flowOn(Dispatchers.IO)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment