Created
April 21, 2017 10:07
-
-
Save laiso/c3009b11caa246c5f92e23a7f8b27b2d 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
// 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