Skip to content

Instantly share code, notes, and snippets.

@JoseAlcerreca
Created July 12, 2018 13:22
Show Gist options
  • Save JoseAlcerreca/b451078d1762d9614ea8f1c9309add4c to your computer and use it in GitHub Desktop.
Save JoseAlcerreca/b451078d1762d9614ea8f1c9309add4c to your computer and use it in GitHub Desktop.
fun getDataForUser(newUser: String?): LiveData<UserDataResult> {
if (newUser == null) {
return MutableLiveData<UserDataResult>().apply { value = null }
}
return userOnlineDataSource.getOnlineTime(newUser)
.combineAndCompute(userCheckinsDataSource.getCheckins(newUser)) { a, b ->
UserDataSuccess(a, b)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment