Skip to content

Instantly share code, notes, and snippets.

@laiso
Created April 21, 2017 10:07
Show Gist options
  • Select an option

  • Save laiso/c3009b11caa246c5f92e23a7f8b27b2d to your computer and use it in GitHub Desktop.

Select an option

Save laiso/c3009b11caa246c5f92e23a7f8b27b2d to your computer and use it in GitHub Desktop.
// ViewModel
completion = myStream.asObservable()
.flatMapLatest {
performOrError()
}
// ViewCOntroller
viewModel.completion.observeOn(MainScheduler.instance)
.retryWhen(showAlert(error:))
.subscribe(onNext: { [weak self] in
self?.dismissViewController()
})
.disposed(by: disposeBag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment