Skip to content

Instantly share code, notes, and snippets.

@sergdort
Last active June 13, 2016 07:32
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 sergdort/20acc409d7eef6a099ee636fb91f1944 to your computer and use it in GitHub Desktop.
Save sergdort/20acc409d7eef6a099ee636fb91f1944 to your computer and use it in GitHub Desktop.
//1
let viewModel = HeroListViewModel(uiTriggers:(
searchQuery: searchCotroller.searchBar.rx_text.asObservable(),
nextPageTrigger: tableView.rx_nextPageTriger,
searchNextPageTrigger: searchContentController.tableView.rx_nextPageTriger
),
api: DefaultHeroAPI(paramsProvider: HeroesParamsProvider.self))
//2
viewModel.mainTableItems
.drive(tableView.rx_itemsWithDataSource(dataSource))
.addDisposableTo(disposableBag)
//3
viewModel.searchTableItems
.drive(searchContentController.tableView.rx_itemsWithDataSource(searchDataSource))
.addDisposableTo(disposableBag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment