Created
April 23, 2017 10:53
-
-
Save Laimiux/21f9e1d35851abf80cf474dca12c2ebe 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
public void onAttach(View view) { | |
// Remember to clean the subscription! | |
repository.getDataEventStream().subscribe({ event -> | |
if (event.isLoading) { | |
view.showLoading(true) | |
} else if (event.hasError()) { | |
view.showError(event.getError()) | |
} else { | |
view.showData(event.getData()) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment