The equivalent of then
for observables would be flatMap
. You can see some examples of use here :
- RxJS Promise Composition (passing data)
- Why we need to use flatMap?
- RxJS sequence equvalent to promise.then()?
For your example, you could do something like :
this._myService.doSomething()
.flatMap(function(x){return functionReturningObservableOrPromise(x)})
.flatMap(...ad infinitum)
.subscribe(...final processing)
Pay attention to the types of what your functions return, as to chain observables with flatMap
you will need to return a promise or an observable.