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
It is clear to me you need to fully switch to importing MQT as you cannot combine MST and MQT.
However, what i am missing is some notes about whether you can use MQT readonly types with mutable MQT types.
For example, can the following be done with this library:
Have readonly MQT type of Song, and a collection Songs.
Have a mutable Playlist type with an array of PlaylistItems.
Have both Songs and Playlist in the same RootStore?
Will this maintain the same performance upgrade that MQT offers on the Song objects (especially their initialization).
Have type.references between PlaylistItem and Song(s).
If this is supposed to work. Would RootStore be a readonly, or mutable store, considering it holds both readonly and mutable MQT types ({ songs: Songs, playlist: Playlist })?
The text was updated successfully, but these errors were encountered:
Hi @jrmyio -- I don't think we've ever tried mixing and matching! At Gadget our tree is either entirely observable or entirely readonly. I suspect it won't work out of the box, but I think you could work around it by setting the parts of your tree that you want to be readonly to use a types.frozen and constructs the readonly instances for those bits before passing the snapshot to your root. We could add a types.readonly that does the instantiation under the hood as well I guess -- that seems generally useful!
Hello,
I have not tried out this library yet but I have faced similar issues this library tries to solve, so I am really interested in giving this a try.
When going over the documentation there is section about mixing MST and MQT:
https://github.com/gadget-inc/mobx-quick-tree#mixing-mobx-state-tree-and-mobx-quick-tree
It is clear to me you need to fully switch to importing MQT as you cannot combine MST and MQT.
However, what i am missing is some notes about whether you can use MQT readonly types with mutable MQT types.
For example, can the following be done with this library:
If this is supposed to work. Would RootStore be a readonly, or mutable store, considering it holds both readonly and mutable MQT types ({ songs: Songs, playlist: Playlist })?
The text was updated successfully, but these errors were encountered: