Skip to content

Instantly share code, notes, and snippets.

@Laimiux
Created March 27, 2018 06:53
Show Gist options
  • Select an option

  • Save Laimiux/fbd3941c3ce7e1bbde8401f2cd94b799 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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