
Loading…
Setting readOnly AND computed on properties #1925
positlabs
commented
Owner
kevinpschaaf
commented
This is a bug.
The expected behavior is that making a property computed should implicitly make it readOnly, since it should never be set from outside, only as a result of the computing function running based on dependencies changing.
Currently it is neither readOnly by default, nor does attempting to make it readOnly manually work, as noted.
positlabs
commented
Nice. Thanks for fixing!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obviously, we can't set a value on a computed property, but setting
readOnly: truecauses the computed property handler to never be called. Maybe there should be some warning, or even an error if a property is configured like this. Or possibly just ignore thereadOnlyflag ifcomputedis defined.