I would like to perform async actions one after another using rxjs. I know that embedding subscribe in a subscribe is not a good practice and there are some other rxjs operators (flatMap\mergeMap, do etc. using pipe).
I need to get the component queryparams, set a global variable (globalVar), and only then, continue with the next async action (this..doSomething()). This is my code using embedded subscriptions: *doSomething return an observable
this.route.paramMap.subscribe(params =>
{
globalVar = + params['userId'];
this.<someService>.doSomething().subscribe(result =>
{
this.func1();
});
}