Skip to content

Instantly share code, notes, and snippets.

@laiso
Created April 21, 2017 10:07
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 laiso/c3009b11caa246c5f92e23a7f8b27b2d to your computer and use it in GitHub Desktop.
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