Skip to content

Instantly share code, notes, and snippets.

@Laimiux
Last active April 23, 2017 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Laimiux/fbd9990d056444523af6ca053c740683 to your computer and use it in GitHub Desktop.
Save Laimiux/fbd9990d056444523af6ca053c740683 to your computer and use it in GitHub Desktop.
Common rx data loading
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