There is existing subject that is in use:
const fooSubject = new BehaviorSubject(null);
And there is another observable (another subject in
Since Subject is already an observer with methods next(), error() and complete() you can just subscribe it to any Observable:
next()
error()
complete()
const fooSubject = new BehaviorSubject(null); const barSubject = new Subject(); barSubject.subscribe(fooSubject); barSubject.next('bar');