I have 2 Subscription - one is a subscription of my ActivatedRoute and another from ngrx Store.
ngOnInit() { this.menuItems$ = this.store.select('menuItems'); this.menuItems$.subscribe(data => { this.menuItems = data.menuItems; }); } ngAfterViewInit() { this.fragmentSubscription = this.route.fragment.pipe( filter((fragment: string) => typeof fragment === 'string') ).subscribe((fragment: string) => { setTimeout(() => { const element: ElementRef = this.menuItems.find(menuItem => menuItem.link === fragment).element; if(element !== undefined) { element.nativeElement.scrollIntoView({ behavior: "smooth", block: "start", inline: "center" }); } }); }); } As my ActivatedRoute (fragment) subscription depends on my store subscription data, I want to delay my ActivatedRoute (fragment) subscription till my Store is subscribed for the first time
Is there any rxjs operator for this?
Tnx
forkJoinlearnrxjs.io/operators/combination/forkjoin.html