Replies: 2 comments
-
Newed an issue #6992 |
Beta Was this translation helpful? Give feedback.
0 replies
-
link #6866 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The image above shows that we are able to use reactive variables on both let and constants. But
const
as a keyword was created so that the developer is not allowed to change the value of that variable. I think an error should be thrown if the user attempts to use a reactive variable on a constant. A framework should not destroy the mechanics of the language that it is built in. A constant is an IMMUTABLE variable. By allowing the user to use the equal sign to change a reactive variable. You are essentially saying that you are allowed to change constants as long as they are created with reactive variables. The const keyword is never supposed to allow the user to change the state of its variable.I can't believe that I was the only one to mention this flaw with reactive variables but this is not good. A constant is an immutable variable regardless of how it was created. I think I raised this issue before. But now I realize that I must be more aggressive when it comes to this problem. No one else found this to be a problem instead they just find this mechanism to be a relief. Which is true
But people should not change variables declared with
const
at all.Beta Was this translation helpful? Give feedback.
All reactions