Skip to content
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): Limit Subject interface public accessibility #2233

Closed
wants to merge 1 commit into from

Conversation

kwonoj
Copy link
Member

@kwonoj kwonoj commented Jan 1, 2017

Description:
This PR updates interface of Subject. I came to notice current Subject interface expose its properties too wide to public scope, any instance of Subject exposes state variables like observers, isStopped can be mutated. This PR limits those variables to inherited scope only, and expose it as readonly property.

It is certainly breaking change since anyone have used those property to change Subject's state now it won't work - but not sure how popular usecase it'll be. (and is it recommended pattern?) For now, I've targeted this into master until gets reviewed and approved.

BREAKING CHANGE: if there's code change state of Subject via publicly exposed properties, it won't work anymore

Related issue (if exists):
Related note, is it worth #2232 to add Subject:hasObservers() interface or should recommend to use Subject::observers.length and update migration guide?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 97.601% when pulling 9357d8a on kwonoj:refactor-subject into 6922b16 on ReactiveX:master.

BREAKING CHANGE: if there's code change state of Subject via publicly exposed properties, it won't

work anymore
@coveralls
Copy link

coveralls commented Jan 1, 2017

Coverage Status

Coverage increased (+0.002%) to 97.692% when pulling a0f2764 on kwonoj:refactor-subject into 6922b16 on ReactiveX:master.

@benlesh
Copy link
Member

benlesh commented Jan 4, 2017

This is akin to my comments on #2234... I'm not sure what this is buying us.

@kwonoj
Copy link
Member Author

kwonoj commented Jan 14, 2017

I'm closing this for now as same reason of #2234.

@lock
Copy link

lock bot commented Jun 6, 2018

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 6, 2018
@kwonoj kwonoj deleted the refactor-subject branch October 4, 2019 05:56
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