-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subject.onNext not a function? #1057
Comments
Due to changes to accommodate the ES7 Observable spec, the API has changed for observables:
I apologize for any confusion. We're working on a migration strategy (probably documentation) to land during the early stages of beta. |
@thunderkid I'm going to close this one for now, as it's not a bug, and I hope that my previous comment addresses your concerns. |
Yes, that fixed it. Thanks. (btw I also noticed bufferWithTime doesn't seem to be there. I'm assuming it's been replaced with bufferTime.) |
@thunderkid ... made this today... just for you: https://github.com/ReactiveX/RxJS/blob/master/MIGRATION.md ;) It's a first go, so I expect it will be improved over the next month or so. |
Brilliant, thanks. That'll remove a bit of guesswork. What's the eta of the 5.0 stable release? |
I didn't realize https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/subjects/subject.md was a different thing than this one, the former has better Google-Fu. |
Do you guys have a plan to give a hint on this document? |
@KunmyonChoi it already does. https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md#observer-interface-changes-also-subjects . Please note given repo is for RxJS v4, does not contain v5 related changes. |
Update file to reflect ES7 spec. https://github.com/ReactiveX/RxJS/blob/master/MIGRATION.md This started changing almost a year ago: ReactiveX/rxjs#1057
oh shit I thought it was completed instead of complete, d'oh! |
honestly, I think it would just be better to alias all of them with the old method names, dunno though |
@ORESoftware that would really confuse newcomers. Starting working with a library that's a rewrite of an old one means not dealing with the old one at all. It's a complete rewrite, meaning it's not the same thing, meaning don't get their APIs mingled. |
@FacelessPanda I am not a huge fan of aliasing, for many reasons, but in this case these methods will never change purpose, so onNext and next should do the same thing, it would be hugely convenient to just make onNext an alias of next, etc. I don't see how it would be confusing to newcomers. All the documentation would point to the new methods, without any mention of the old. If someone forgets somewhere deep in a codebase to change onNext to next, then it will be simply convenient. The change from onNext to next is not about breaking changes, it's about conforming to the ES7 spec, so it's really just not necessary to creating breaking changes when you're just renaming things. This is a case where aliasing would actually be just straight up a good thing. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm trying to get Rx Subjects to work following the RxJs docs. I'm using:
But typescript tells me onNext is not a function, and if I force it with subject:any, the browser also tells me
subject.onNext is not a function
. Has the syntax changed?The text was updated successfully, but these errors were encountered: