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

Is it possible to have a Read-Only reference to something? #34

Open
offsides opened this issue Aug 14, 2018 · 0 comments
Open

Is it possible to have a Read-Only reference to something? #34

offsides opened this issue Aug 14, 2018 · 0 comments

Comments

@offsides
Copy link

I have a configuration object that should only be modified by internal modules, but occasionally needs to be read via external pieces of the process. I think the answer is no, but is it possible to take a reference to an object and flag it as read-only such that the original object is untouched, but any access through the new reference is treated as read-only (while still pointing to the original object)? I'm pretty sure that there is no good way to do this, but I figured it couldn't hurt to ask...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant