Created
January 8, 2019 09:09
-
-
Save ywett02/35b023247a6eba825145cd15de5ca51d 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 MyProfileViewModel { | |
val progress = MutableLiveData() | |
val myProfile = MutableLiveData() | |
override fun loadProfile() { | |
progress.value = true | |
subscriptions.add( | |
myProfileInteractor.getLoggedUser().subscribe( | |
object : Subscriber<UserEntity>() { | |
override fun onCompleted() { | |
progress.value = false | |
} | |
override fun onError(e: Throwable) { | |
handleError(e) | |
} | |
override fun onNext(userEntity: UserEntity) { | |
userInteractor.setUser(userEntity) | |
myProfile.value = userEntity | |
} | |
} | |
) | |
) | |
} | |
override fun handleEditProfileClick() { | |
/***/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment