3

For me it's advantage of BehaviorSubject over Subject, that the first one always returns value, so why one of the rxjs lint rules says it's forbidden?

example:

private _languageSource$ = new BehaviorSubject<string>("EN");

get language(): string {
  return this._languageSource$.value;
}
Tomasz Iz
  • 177
  • 1
  • 7
  • 3
    This comment explains this https://stackoverflow.com/questions/37089977/how-to-get-current-value-of-rxjs-subject-or-observable#comment77420190_37089997 – martin Aug 23 '18 at 14:08

0 Answers0