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

Swagger for Azure functions: Undocumented TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body. Fixed.

System.Net.Http.HttpClient' does not contain a definition for 'PostAsJsonAsync

Fixed: The required column was not present in the results of a 'FromSql' operation in asp.net core EF core