How to map from Swift 5 Resul to RxSwift PublishSubject

Issue #214

1
2
3
4
5
6
7
8
9
10
extension Result {
func to(subject: PublishSubject<Success>) {
switch self {
case .success(let value):
subject.onNext(value)
case .failure(let error):
subject.onError(error)
}
}
}

Comments