I have 2 subsciptions on 2 different observables. If they are both "firing" at the same time i just want to execute 1 of them

58 views Asked by At

I have 2 observable with a subscription on each of them. my problem is, if they fire at the same time, the code is influencing each other, so just the functionality of subscription 1 should be fired and sub 2 should be ignored.

this.windowRef.window.instance.resizeEnd
            .pipe(takeUntilDestroyed(this.destroyRef))
            .subscribe(() => {
                //...some code
            });

        this.windowRef.window.instance.stateChange
            .pipe(takeUntilDestroyed(this.destroyRef))
            .subscribe((state) => {
               //... some code
            });

i tried it to solf with rxjs zip, but came here to the problem i have to wait for all subscribe to fire until it triggers, so it won't work there for me

0

There are 0 answers