You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Subject.create is built to mimic it's behavior in v4 and under. That is that Subject.create actually returns an AnonymousSubject, and not a Subject.
Problem
This flies in the face of other uses of create in this library, which is as an alternative to new... for example: new Observable(fn) vs Observable.create(fn). This creates confusion for users (and experts, apparently)
We can't move AnonymousSubject into it's own module, because there would be a circular reference with Subject, which has this create method that only creates an AnonymousSubject.
Proposal:
Subject.create becomes alternative version of new Subject
AnonymousSubject.create does what Subject.create does now... which is just an alternative version to new AnonymousSubject.
move AnonymousSubject to it's own module.
The text was updated successfully, but these errors were encountered:
This is really confusing behaviour. I figured, since new Observable() and Observable.create() are basically the same, that new Subject() and Subject.create() would also be the same. How wrong I was!
#2002 was merged but that doesn't make AnonymousSubject public. For this it would need to be listed here as well https://github.com/ReactiveX/rxjs/blob/master/src/index.ts#L10.
Also new AnonymouseSubject(...) supports a destination and source parameter, while new Subject() or Subject.create() do not. Some comment on how to translate would be great when one is deprecated.
Related #2002, #2003, #1996, #1975
Currently,
Subject.create
is built to mimic it's behavior in v4 and under. That is thatSubject.create
actually returns anAnonymousSubject
, and not aSubject
.Problem
create
in this library, which is as an alternative tonew
... for example:new Observable(fn)
vsObservable.create(fn)
. This creates confusion for users (and experts, apparently)AnonymousSubject
into it's own module, because there would be a circular reference withSubject
, which has this create method that only creates anAnonymousSubject
.Proposal:
Subject.create
becomes alternative version ofnew Subject
AnonymousSubject.create
does whatSubject.create
does now... which is just an alternative version tonew AnonymousSubject
.AnonymousSubject
to it's own module.The text was updated successfully, but these errors were encountered: