Skip to content

Instantly share code, notes, and snippets.

@Laimiux
Created April 23, 2017 10:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Laimiux/21f9e1d35851abf80cf474dca12c2ebe to your computer and use it in GitHub Desktop.
Save Laimiux/21f9e1d35851abf80cf474dca12c2ebe to your computer and use it in GitHub Desktop.
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