I have 2 separate observables that emit respectively success and error for a specific request. I'm wrapping this in a new observable, that triggers the request and returns a
Single
with success/error state. Thinking about how to implement this. Something like
Copy code
val successObservable: Observable<SomeType>
val errorObservable: Observable<AnotherType> // AnotherType can be mapped into a Throwable
request.flatMap {
// First event of successObservable OR errorObservable. successObservable -> just(event), errorObservable -> error(error)
}