Can a model be a regular RealtimeProperty inside another model?
For clarity, I just want to use a model inside another model (and not as part of a colleciton). This is for code modularity reasons.
Also - is there any overhead of working this way (assume no meta-model on the nested model)?
3 Replies
Hi @Niv. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, you can use a model as a regular RealtimeProperty inside another model in Normcore. This is supported and works as expected for code modularity. The documentation provides an example of a nested model:
All functionality will work as expected when nesting models this way. There is no requirement for the nested model to be part of a collection; it can be a direct property of the parent model. This approach is explicitly supported for modularity and organization of your data structures.
Regarding overhead: The documentation does not mention any significant overhead for using nested models in this way, especially if you are not enabling a meta-model on the nested model. The main consideration is that all state is still synchronized as part of the parent model, and the usual Normcore synchronization and change detection mechanisms apply. There is no indication of additional performance or bandwidth cost beyond what is expected for synchronizing the properties you define in your models. The equality check setting also has no effect on nested model properties, so updates are handled as with other properties Supported Primitives.
In summary:
- Yes, you can nest models as regular properties for modularity. - No special overhead is mentioned for this pattern (without meta-model). - All standard synchronization rules apply. For more details, see the section on nested models in the documentation Supported Primitives. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
- Yes, you can nest models as regular properties for modularity. - No special overhead is mentioned for this pattern (without meta-model). - All standard synchronization rules apply. For more details, see the section on nested models in the documentation Supported Primitives. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@269927864265211906> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Wow the more you know, how awesome is that