Reputation: 875
The case is following. I have a Single that I receive from a third-party API. I want to transform this single to Observable, but the issue is Single transformed to Observable still completes my observable chain after emitting a value which I don't want to happen. I want that my observable never completes.
The question is is there any way easier than 'single.flatMap{ Observable.just($0)}' to do what I want?
Upvotes: 3
Views: 3701
Reputation: 33979
I'd love to see some more code, because single.flatMap { Observable.just($0) }
will not stop a completion event from happening so if you think it does, then something's wrong.
Frankly, .flatMap { Observable.just($0) }
does nothing at all, i.e., you could remove it completely and not change your code at all.
That said, the most obvious way to stop a completed event is single.concat(Observable.never())
.
Upvotes: 3