Solved: RangeError: Maximum call stack size exceeded when using valueChanges.subscribe

RangeError: Maximum call stack size exceeded when using valueChanges.subscribe

public tokenAcquired: BehaviorSubject<any> = new BehaviorSubject<any>('');

//from where you want to trigger the subscription
this.appService.tokenAcquired.next(tokenStored.accessToken);


//where you are subscribing

this.appService.tokenAcquired.pipe(
    distinctUntilChanged()) // it will emit if value is different then last
    .subscribe((token) => {
      if (this.debugMode) {
        console.log("token acquired and calling getApps.");
      }
      this.getApps();
    })

Comments

Popular posts from this blog

npm ERR! Unable to authenticate, need: Bearer authorization_uri=https://login.windows.net/*********, Basic realm="https://pkgsprodcus1.pkgs.visualstudio.com/", TFS-Federated Fixed

ERR_CONNECTION_RESET - when you run application from visual studio over https

Azure - Failed to deploy web package to App Service. Internal Server Error (CODE: 500)- Fixed