Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
func bind(reactor: UserViewReactor) {
// Action
self.followButton.rx.tap
.map { Reactor.Action.follow }
.bind(to: reactor.action)
.disposed(by: self.disposeBag)
// State
reactor.state.map { $0.isFollowing }
.distinctUntilChanged()
.bind(to: self.followButton.rx.isSelected)
.disposed(by: self.disposeBag)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment