Created
April 16, 2020 23:24
-
-
Save DenisBronx/81647016d56075373b1ea46e2d69aa82 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class AlbumRepositoryImpl( | |
private val albumApiService: AlbumApiService, | |
private val albumDataMapper: Mapper<NetworkAlbum, Album> | |
) : AlbumRepository { | |
override fun getAlbumById(id: String): Single<SimpleResult<Album>> { | |
return albumApiService.getAlbumById(id).map { | |
it.fold( | |
success = { dto -> Result.Success(albumDataMapper.map(dto)) }, | |
failure = { throwable -> Result.Failure(throwable) } | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment