-
Notifications
You must be signed in to change notification settings - Fork 12
Description
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.