I don't know if I understood 100% of model struct, are we able to create a model with immutable values and the compiler considers the model itself as an observable or only mutable fields are supported?
l
Leland Richardson [G]
05/12/2019, 6:29 PM
you can have immutable fields on the model but only the mutable fields will be the things that are “observed” in this way. As a result, a fully immutable class (ie, all val properties) annotated as @Model is somewhat meaningless. Not sure if that answers your question though
b
bloder
05/12/2019, 8:22 PM
Yeah this answer my question, thank you! I ask that because I don't know if I'm comfortable to use mutable models, but I also don't know if an immutable state api should be implemented on compose lib side because its possible performance problems.