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

A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance