-
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
fix(Subject): do not expose static create method to inherited #1894
Conversation
I'm feeling this might not be correct understanding of removing static interfaces or either incorrect implementation of having abstract classes - please feel freely close if PR is not feasible. |
..Or instead static creation method to comply inherited classes (similar to #1876) |
As discussed in #1890, there may be merit to adding support for
|
: I think that's legit point that I couldn't think of at the moment writing PR. do we have general usecases for checking types of inherited subjects? |
Not really for class ActionsObservable extends Observable<Action> {
constructor(source$: Subject<Action>) {
this.source = source;
}
}
const source$ = new ReplaySubject<Action>();
const action$ = new ActionsObservable(source$);
// type error: ReplaySubject does not match type Subject (we do this pattern, but not currently using TypeScript so wouldn't impact us at the moment) This isn't the end of the world. It's just changing |
gotcha, you're correct. This PR makes breaking change to consumers should accept |
I tried small snippet here and at least as long as My current feeling is rather document |
closing PR without check in as intended design is to support |
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. |
Description:
This PR aligns interface of classes inherited from
Subject<T>
, do not expose static creation method by introducing abstract classSubjectBase<T>
.Related issue (if exists):
closes #1890