Skip to content

Instantly share code, notes, and snippets.

@DenisBronx
Created April 16, 2020 23:48
Show Gist options
  • Save DenisBronx/4115ae0973d6f3ec20c279e5439afc48 to your computer and use it in GitHub Desktop.
Save DenisBronx/4115ae0973d6f3ec20c279e5439afc48 to your computer and use it in GitHub Desktop.
object FPRepositoryFactory {
fun makeAlbumRepository(): AlbumRepository {
return AlbumRepositoryImpl(
AlbumApiServiceImpl(),
makeAlbumDataMapper()
)
}
private fun makeAlbumDataMapper(): (NetworkAlbum) -> Album = { albumDto ->
mapAlbumDto(albumDto) { listItemDto ->
mapNullInputList(listItemDto) { songDto ->
mapSongDto(songDto)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment