I am just starting to learn RxJS when I came across two different definitions of Observable:
- https://reactivex.io/rxjs/class/es6/Observable.js~Observable.html
- https://rxjs.dev/api/index/class/Observable
Which one is legitimate?
I am just starting to learn RxJS when I came across two different definitions of Observable:
Which one is legitimate?
I guess that the first one seems to be an old implementation of the RxJs Observable.
In that page itself, if you click on the RxJs nav "HOME", it says "Rediring to newer docs" and navigates to the second one version.
It’s good that you are digging through the source code. Take a look at the npm package “rxjs-compat” this contains additional information about migrating from the previous version of rxjs to the latest version. To be more direct the actual implementation of rxjs observable is different compared to previous versions rather the approach that you would take to require vs import Observable then used to instantiate observables has slightly changed. Fundamentally observables in previous versions and the new version are the same but looking at old code may be confusing in the context of the latest version. Focus on the latest version and take a look at articles or presentations by Ben Lesh if you want to learn RxJS intricacies.