Skip to content

Instantly share code, notes, and snippets.

@Laimiux
Created March 27, 2018 06:53
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/fbd3941c3ce7e1bbde8401f2cd94b799 to your computer and use it in GitHub Desktop.
Save Laimiux/fbd3941c3ce7e1bbde8401f2cd94b799 to your computer and use it in GitHub Desktop.
class CommentFormPresenter(val viewModel: CommentViewModel) {
fun attach(view: CommentFormView) {
// Don't forget to unsubscribe
viewModel.viewStateStream().subscribe { state ->
view.setViewState(state)
}
}
}
@colinrtwhite
Copy link

viewModel -> viewState. Also, I'd show the detach method + clearing the disposables as well just to be explicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment