Non observable object #322
-
Quick question - is there anyway to ensure a specific prop is not returned as as a deep observable object? We have a We have been using mobx's toJS on this object but we take quite a performance hit.
cc @vojto / @xaviergonz |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Maybe a transformer that puts it in a mobx box? |
Beta Was this translation helpful? Give feedback.
-
do you need to to be serializable? if not then maybe put it outside the model props
alternatively, if you need it to be a model prop and the object is immutable you might use 'frozen' |
Beta Was this translation helpful? Give feedback.
do you need to to be serializable? if not then maybe put it outside the model props
alternatively, if you need it to be a model prop and the object is immutable you might use 'frozen'
https://mobx-keystone.js.org/frozen