You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microstates are immutable, as such changing value on state property doesn't make sense. Unfortunately, some components do this without the developer realizing it.
Currently, if Ember tries to set state property, the developer will get an error like this: Uncaught TypeError: Cannot set property state of #<Primitive> which has only a getter.
This is not very descriptive. Instead, we should give them an error that tells them why this might be happening. Something like this: Ember tried to mutate the state property of a microstate locatet at [path]. You might have the state property two way bound to a property of a component. [link to readme with more information].
To make this change, we could add a setter for the state property to each primitive type. There might be a better way to do it, but it'd require changes to Microstates.js library.
The text was updated successfully, but these errors were encountered:
Microstates are immutable, as such changing value on
state
property doesn't make sense. Unfortunately, some components do this without the developer realizing it.Currently, if Ember tries to set
state
property, the developer will get an error like this:Uncaught TypeError: Cannot set property state of #<Primitive> which has only a getter
.This is not very descriptive. Instead, we should give them an error that tells them why this might be happening. Something like this:
Ember tried to mutate the
stateproperty of a microstate locatet at [path]. You might have the state property two way bound to a property of a component. [link to readme with more information]
.To make this change, we could add a setter for the
state
property to each primitive type. There might be a better way to do it, but it'd require changes to Microstates.js library.The text was updated successfully, but these errors were encountered: