Coming from another question, while doing a demo I found a strange bug that I fixed by pure chance.
private updateCurrentCharacter() : void {
this.fetchCharacter(this.currentCharacter)
.subscribe(
character => this.characterSubject.next(character)
);
}
This code will work, but
private updateCurrentCharacter() : void {
this.fetchCharacter(this.currentCharacter)
.subscribe(
this.characterSubject.next
);
}
But this one wont, with Angular throwing the following error: General error observers is undefined
Anyone has any idea why is that? From my understanding, subscribe is a lazy operation, and both codes are idempotent.
You can try it on this demo: Demo