There are two observables: a
and b
. I want to subscribe to the second observable (b
) after first observable (a
) has fired (i.e. has generated very first onNext
event).
I tried
b.skipUntil(a).subscribe(onNext:{
print("B: \($0)")
}).disposed(by: _bag)
but with no luck because b
is a cold observable. As I understand, it starts immediately and gets blocked by skipUntil(a)
.
This approach seems to work:
a.subscribe(onNext:{_ in
// ... handle a ...
b.subscribe(onNext:{
print("B: \($0)")
}).disposed(by: self._bag)
}).disposed(by: _bag)
but I realise this is a bad practise and not a way to go.