-
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
Remove static create
methods and provide importable functions instead
#3513
Comments
if we're going to away from exposing creation method directly, what makes us prevent just let ppl use class ctor instead of exporting another function for creation? |
89 tasks
I think this is a non-issue these days. Closing for now. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The static
create
methods were a good idea, but they suffer from a couple of issues:Subject
inherits fromObservable
andBehaviorSubject
inherits fromSubject
... all of them have (or should have) wildly different signatures forcreate
.BehaviorSubject
suffer from bugs like BehaviorSubject created with "create" does not have getValue() method #1890.Subject.create
doesn't even do what the rest of the create methods do (which is just proxy the constructor), instead it returns anAnonymousSubject
, which is really just any old observer "glued" to any old observable to make a subject. So we might want to change that tocreateSubject
orfrankenSubject
orglueSubject
(okay, I'm kidding on the last two) (but the nameAnonymousSubject
sorta sucks too)Proposed solution
Create functions that do the same work and export them separately:
The text was updated successfully, but these errors were encountered: