readonly icon indicating copy to clipboard operation
readonly copied to clipboard

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

Open offsides opened this issue 7 years ago • 0 comments

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...

offsides avatar Aug 14 '18 16:08 offsides