I am new to the RxJs observables and I am finding difficulty in unsubscribing the loop once the criteria are met, can you please help me
In the below function if anytime the code reaches the if block I wanted to unsubscribe the Observables
Before asking this questions I have gone through below questions and none of them helped me much
Javascript Function
this.router.events.subscribe((url: any) => {
url = this.router.url;
if ((url === "/profile" || url === "/summary") && this.filterConfigFlag === false) {
/*
Perform operations
*/
} else {
console.log(typeof (url), url);
}
});