-
-
Save skydoves/19888072039dc3eaeeafdfcc852b646f to your computer and use it in GitHub Desktop.
handle_api_data_layer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface PosterService { | |
@GET("DisneyPosters.json") | |
suspend fun fetchPosters(): Response<List<Poster>> | |
} | |
class PosterRemoteDataSource( | |
private val posterService: PosterService | |
) { | |
suspend operator fun invoke(): NetworkResult<List<Poster>> = | |
handleApi { posterService.fetchPosters() } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment