Skip to content

refactor(ConnectableObservable): hide ConnectableObservable's members from public - #1244

Merged
kwonoj merged 1 commit into
ReactiveX:masterfrom
tetsuharuohzeki:ConnectableObservable
Feb 3, 2016
Merged

kwonoj merged 1 commit into
ReactiveX:masterfrom
tetsuharuohzeki:ConnectableObservable

Conversation

@tetsuharuohzeki

Copy link
Copy Markdown
  • ConnectableObservable<T>'s members may be overridden by user. So this change make them protected for extensibility.
  • RefCountSubscriber<T>_resetConnectable() belongs to ``RefCountSubscriberwhich is private class in ConnectableObservable.ts. So this change make itprivate`.
  • To protect unexpected modifying ConnectableObservable<T>.subject/subscription from others, this change make them protected and add _closeSubscription() for ConnectableSubscription

@tetsuharuohzeki

Copy link
Copy Markdown
Author

@kwonoj updated. could you review this?

@kwonoj

kwonoj commented Feb 1, 2016

Copy link
Copy Markdown
Member

Would you mind to squash some of commits? Seems it doesn't need to breakdown into those numbers of commits.

Comment thread src/observable/ConnectableObservable.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there reason to make private field starts with _? Current codebase usually do not use those convention only except if field has separate getter / setter.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwonoj

Ah, I felt there are some implicit customs which is start with _ to mark a property as a private.
okay. I'll fix it

@tetsuharuohzeki

Copy link
Copy Markdown
Author

updated

@tetsuharuohzeki

Copy link
Copy Markdown
Author

@kwonoj updated

Comment thread src/observable/ConnectableObservable.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just curiosity and assume it's not - does this comment appears editor's intellisense for typings? does JSDoc style comment appears?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least on vscode, JSDoc style will appear.

@tetsuharuohzeki

Copy link
Copy Markdown
Author

fixed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than this comment, I'd just name it _closeSubscription ... generally, _name is idiomatic in the JavaScript community for "this is not a public API".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I was suggested closeSubscription in opposite to @saneyuki did in first way. My bad, and sorry @saneyuki for making redo work.

@benlesh

benlesh commented Feb 2, 2016

Copy link
Copy Markdown
Member

This LGTM, other than the one comment I left. Once you get that fixed it can be merged.

@benlesh benlesh added the blocked label Feb 2, 2016
@tetsuharuohzeki

Copy link
Copy Markdown
Author

@kwonoj @Blesh

I fixed non public api to _closeSubscription.

@kwonoj kwonoj removed the blocked label Feb 3, 2016
@kwonoj
kwonoj merged commit 3c43c84 into ReactiveX:master Feb 3, 2016
@kwonoj

kwonoj commented Feb 3, 2016

Copy link
Copy Markdown
Member

Merged with 3c43c84, thanks @saneyuki

@tetsuharuohzeki
tetsuharuohzeki deleted the ConnectableObservable branch February 3, 2016 10:10
@lock

lock Bot commented Jun 7, 2018

Copy link
Copy Markdown

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.

@lock lock Bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants