What is the best practice when I need to use switchMap on an Observable twice (independent queries). I need the Id returned from activeRoute.ParamMap... for two independent queries. For only one query, I would do the following:
this.route.paramMap
.switchMap((params: ParamMap) =>
this.service.getSomeInformation(params.get('id')));
and now I need the Id returned from the route for another query
this.route.paramMap
.switchMap((params: ParamMap) =>
this.AnotherService.getSomeMoreInformation(params.get('id')));
so I need the Id extracted from paramMap as input for service and for anotherService.
What is the best practice? Just chain them? The timing of the Observables from Service and AnotherService is irrelevant.
Since this is my first question here, please let me know what I can do better in the next question(s).
Thank you, steffen