Last active
July 9, 2020 02:07
-
-
Save O-O-wl/3879af52753985bb6ec9f2601dca48e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func render(for state: Observable<ViewModel.State>) { | |
state.map { $0.onProcess } | |
.distinctUntilChanged() | |
.bind(to: indicator.rx.isAnimating) | |
.disposed(by: disposeBag) | |
state.map { $0.searchResults } | |
.distinctUntilChanged() | |
.bind(to: tableView.rx.items(cellIdentifier: ReuseIdentifier.default)) { indexPath, searchResult, cell in | |
cell.configure(searchResult) | |
} | |
.disposed(by: disposeBag) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment