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
feat(Observable): RxJS doesn't even lift. #7202
Conversation
5bd1e2e
to
d9caf67
Compare
+ Removes `lift`, `source`, and `operator` from `Observable` + Updates related code BREAKING CHANGE: `Observable#lift`, `Observable#source`, and `Observable#operator` is no longer a part of the API. These were never meant to be public and have been deprecated for more than 3 years. Resolves ReactiveX#7201
d9caf67
to
c921203
Compare
@@ -108,7 +100,7 @@ export class Subject<T> extends Observable<T> implements SubscriptionLike { | |||
|
|||
/** @internal */ | |||
protected _subscribe(subscriber: Subscriber<T>): Subscription { | |||
this._throwIfClosed(); | |||
// this._throwIfClosed(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any additional change planned?
// this._throwIfClosed(); |
export function operate<T, R>( | ||
init: (liftedSource: Observable<T>, subscriber: Subscriber<R>) => (() => void) | void | ||
): OperatorFunction<T, R> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export function operate<T, R>( | |
init: (liftedSource: Observable<T>, subscriber: Subscriber<R>) => (() => void) | void | |
): OperatorFunction<T, R> { | |
export function operate<T, R>( | |
init: (source: Observable<T>, subscriber: Subscriber<R>) => (() => void) | void | |
): OperatorFunction<T, R> { |
Probably JSDoc should also be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll address this in a followup.
@@ -17,16 +9,5 @@ export function hasLift(source: any): source is { lift: InstanceType<typeof Obse | |||
export function operate<T, R>( | |||
init: (liftedSource: Observable<T>, subscriber: Subscriber<R>) => (() => void) | void | |||
): OperatorFunction<T, R> { | |||
return (source: Observable<T>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the file name is no longer true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll address this in a followup.
I blame @jayphelps |
@benlesh so do I. |
protected _subscribe(subscriber: Subscriber<any>): TeardownLogic { | ||
return this.source?.subscribe(subscriber); | ||
protected _subscribe(_subscriber: Subscriber<any>): TeardownLogic { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just use an empty body here?
@@ -237,7 +237,7 @@ describe('delay', () => { | |||
const result = e1.pipe( | |||
repeatWhen((notifications) => { | |||
const delayed = notifications.pipe(delay(t)); | |||
subscribeSpy = sinon.spy((delayed as any)['source'], 'subscribe'); | |||
subscribeSpy = sinon.spy(notifications as any, 'subscribe'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit but I believe you can do sinon.spy<any>(notifications)
instead
observer.complete(); | ||
return { | ||
unsubscribe() { | ||
// noop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to verify this was called? If not can we remove this?
+ Inlines all operator function creation as just arrow functions. After `lift` was removed, there is no use for the `operate` function. Related ReactiveX#7202
* refactor: Remove `operate` function + Inlines all operator function creation as just arrow functions. After `lift` was removed, there is no use for the `operate` function. Related #7202 * refactor(find): reduce complexity in function calls + Removes use of higher-order function, as it's no longer necessary, because we're not using `operate`, because we don't even `lift`. * refactor(scan/reduce): reduce complexity in function calls + Removes use of higher-order function, as it's no longer necessary, because we're not using `operate`, because we don't even `lift`. * chore: Address comments * chore: forgot to commit
Removes
lift
,source
, andoperator
from the Observable API. These have been deprecated for more than 3 years. It's time.#7201