Skip to content

Commit

Permalink
Merge comment and postsuccessful streams
Browse files Browse the repository at this point in the history
  • Loading branch information
leighdouglas committed Jul 16, 2021
1 parent 6704a0d commit 5c6ca10
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -128,10 +128,10 @@ interface CommentsViewHolderViewModel {

init {

val comment = this.commentInput
.map { it.comment }
val comment = Observable.merge(this.commentInput.map { it.comment }, postedSuccessfully)
.filter { ObjectUtils.isNotNull(it) }
.map { requireNotNull(it) }

configureCommentCardWithComment(comment)

val commentCardStatus = this.commentInput
Expand Down Expand Up @@ -234,7 +234,6 @@ interface CommentsViewHolderViewModel {

comment
.compose(takeWhen(this.onViewCommentRepliesButtonClicked))
.map { postedSuccessfully?.value ?: it }
.compose(bindToLifecycle())
.subscribe(this.viewCommentReplies)

Expand All @@ -245,7 +244,6 @@ interface CommentsViewHolderViewModel {

comment
.compose(takeWhen(this.onReplyButtonClicked))
.map { postedSuccessfully?.value ?: it }
.compose(bindToLifecycle())
.subscribe(this.replyToComment)

Expand Down

0 comments on commit 5c6ca10

Please sign in to comment.