The two are different. A BehaviorSubject represents a value that changes over time — rather than a series of events — and it is already an Observable. For change notifications to be emitted, someone has to call next on the BehaviorSubjet. That is, the calling code has to deal with an Observable.

The mechanism outlined in the article is for situations in which the caller is not dealing with an Observable — e.g. the caller is just setting a property or is calling a method. rxjs-observe uses a proxy so that the caller can continue setting properties or calling methods, but the consumer can deal with an Observable that emits next notifications whenever the caller sets a property or calls a method.

If you look at the implementation of rxjs-observe, you’ll see that a BehaviorSubject is used for properties of the proxied object — so that subsequent subscriptions receive the property’s current value.

RxJS core team member; front-end developer; mentor; speaker; open-source contributor

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store