Created
January 8, 2021 15:13
-
-
Save ngallazzi/71814752bbe989c7f20e1a4124b37f74 to your computer and use it in GitHub Desktop.
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
class BooksRepositoryImpl( | |
private val localDataSource: BooksLocalDataSource, | |
private val remoteDataSource: BooksRemoteDataSource | |
) : BooksRepository { | |
override suspend fun getRemoteBooks(author: String): Result<List<Volume>> { | |
return remoteDataSource.getBooks(author) | |
} | |
override suspend fun getBookmarks(): Flow<List<Volume>> { | |
return localDataSource.getBookmarks() | |
} | |
override suspend fun bookmark(book: Volume) { | |
localDataSource.bookmark(book) | |
} | |
override suspend fun unbookmark(book: Volume) { | |
localDataSource.unbookmark(book) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment