RxResult provides helpful methods to manage Observable RxSwift streams with Result values. Allowing you to subscribe only to success or failure cases, but also calling doOn methods on top of it.
let result: Observable<Result<String, JSONError>> = ...
result.doOnSuccess { value in
print("success with \(value)")
}.doOnFailure { error in
print("failure with \(error)")
}.subscribeSuccess { value in // or subscribeFailure
print("subscribed with success \(value)")
}.addDisposableTo(disposeBag)RxResult is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "RxResult"RxResult is available under the MIT license. See the LICENSE file for more info.