Skip to content

Custom classes & tweaking issues #498

Answered by xaviergonz
maccman asked this question in Q&A
Discussion options

You must be logged in to vote

Does that class need to be serializable (fromSnapshot/getSnapshot support) or support for JSON patches and so on?

Where I'm heading is that if that class is UI related rather than document related then maybe it doesn't need those capabilities and so it could be a mobx / plain class to save memory. If it is a document related model then probably it already needs all that and there's no way around it.

Usually the pattern I find the best is having the "document model" exclusively made with mobx-keystone (and that way it is easier to serialize via fromSnapshot/getSnapshot) so it is not polluted with UI stuff, and then there's a UI model (probably made with mobx classes) that occasionally poin…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@vojto
Comment options

@maccman
Comment options

@maccman
Comment options

@xaviergonz
Comment options

@maccman
Comment options

Answer selected by maccman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants