Is legal returning implicitly readonly state? #2756
-
Based on this sentence in the Pinia documentation:
Am I asking to myself if something like this is ok
Basically the original count is not readonly, and it can be updated by the increment function. Is this approach violating the rule mentioned previously? 👇🏼
Or is totally fine doing it in this way? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
It's not allowed (it's explicitly mentioned in the docs you quote). The only fully safe way of having private (or readonly state) is by moving it into another store that returns a regular writable state |
Beta Was this translation helpful? Give feedback.
It's not allowed (it's explicitly mentioned in the docs you quote). The only fully safe way of having private (or readonly state) is by moving it into another store that returns a regular writable state