Created
December 15, 2020 10:54
-
-
Save k1dbl4ck/f1b34ef750f9620be064c53b2f8e0aa2 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 UserInfoRepository( | |
private val userInfoLocalDataSource: LocalDataSource<String, UserInfoDataModel>, | |
private val userInfoRemoteDataSource: RemoteDataSource<UserInfoDataModel> | |
) : CachePolicyRepository<UserInfoDataModel>( | |
localDataSource = userInfoLocalDataSource, | |
remoteDataSource = userInfoRemoteDataSource | |
) { | |
suspend fun get(key:String, cachePolicy: CachePolicy): UserInfoDomainModel { | |
val userInfo:UserInfo? = cacheFetch(key, cachePolicy) | |
// Do your mapping, etc. and return domain model | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment