Last active
April 23, 2017 11:04
-
-
Save Laimiux/fbd9990d056444523af6ca053c740683 to your computer and use it in GitHub Desktop.
Common rx data loading
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
public void onAttach(View view) { | |
view.showLoading(true) | |
repository.getData().subscribe({ data -> | |
view.showLoading(false) | |
view.showData(data) | |
}, { error -> | |
view.showLoading(false) | |
// should we have a retry action? | |
view.showError("boo!") | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment