I need to run sequentially two observables and returns the result of the first observable only. The second observable needs the first to be completed before running.
I found a workaround but I'm not satisfied. You can test it here : plunker test
const first = Observable.of(10).delay(1000).do(res => console.log('first'));
const second = Observable.of(20).do(res => console.log('second'));
console.log('start');
const test = first.concatMap(ev => second.map(x=> ev)).subscribe(res =>
console.log(res));
I think (and I hope !) a nicer solution exists but I can't find it. Thanks in advance for your help.