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
chore(refCount): remove unnecessary reference of object #4720
Conversation
Pull Request Test Coverage Report for Build 8388
💛 - Coveralls |
I'm not sure how I feel about exposing all of these properties as public. They really aren't meant to be consumed by other users. |
2d70c6c
to
02a9eac
Compare
02a9eac
to
793056f
Compare
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.
protected _refCount: number = 0; | ||
protected _connection: Subscription; | ||
private _refCount: number = 0; | ||
private _connection: Subscription; |
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.
This is technically a breaking change for TypeScript users.
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.
Yeah, as this would be a breaking change, I don't see any advantage to changing these to private
. Especially as this is a 'perf' PR. This is unrelated to perf.
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.
reverted to protected
} as MonoTypeOperatorFunction<T>; | ||
} | ||
|
||
class RefCountOperator<T> implements Operator<T, T> { | ||
constructor(private connectable: ConnectableObservable<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.
Removing the constructor is also a breaking change.
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'm fine with this. AFAICT, this is not a breaking change as RefCountOperator
is not exported. And if someone has reached into the internals to get it and this breaks them, then that's on them for being naughty.
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'm fine with this PR. But I don't think the access modifiers should be changed to private
.
protected _refCount: number = 0; | ||
protected _connection: Subscription; | ||
private _refCount: number = 0; | ||
private _connection: Subscription; |
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.
Yeah, as this would be a breaking change, I don't see any advantage to changing these to private
. Especially as this is a 'perf' PR. This is unrelated to perf.
} as MonoTypeOperatorFunction<T>; | ||
} | ||
|
||
class RefCountOperator<T> implements Operator<T, T> { | ||
constructor(private connectable: ConnectableObservable<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.
I'm fine with this. AFAICT, this is not a breaking change as RefCountOperator
is not exported. And if someone has reached into the internals to get it and this breaks them, then that's on them for being naughty.
revert private to protected
Yeah,i gave it a second thought. This commit indeed is just removing the unnecessary reference of |
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.
LGTM
This was mostly just to get CI to kick off again.
Again, I was really only doing this to kick off CI. LOL... My silly change in the dark from the GitHub UI didn't work. :)
Really I'm just kicking CI again. (and I made a dumb mistake on the last one)
Description:
Since the
source
and theconnectableObservable
is the same thing in RefCountOperator, there is no need to hold the variableconnectable
int the RefCountOperatorRelated issue (if exists):
NONE