Created
February 12, 2019 15:30
-
-
Save wellingtoncosta/a7af62466c5be424125dff59b850781a 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 UserDataRepository( | |
private val api: GithubApi | |
) : UserRepository { | |
override suspend fun getAll() = withContext(IO) { | |
async { api.getAll().await().map { it.toModel() } } | |
} | |
override suspend fun getByUsername(username: String) = withContext(IO) { | |
async { api.getByUsername(username).await().toModel() } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment