Open ThaJay opened 11 months ago
I have some kind of a ORM with Mobx stores. The data is relational and has a tree like structure.
One Location
has many Connection
s, has many Usage
s.
I would love to be able to save my whole tree.
Now I can only save the non recursive elements of the tree. That is, only the models that can ever have only one instance.
Soooo. It's really hard to persist recursive trees and I don't know how soon we can do it. You would better writing your own solution
Thank you for your answer. Perhaps I should start reading about Mobx State Tree again.
Example:
How would this work?
At the moment I may be able through some finaggling save WidgetStore instances on ChosenWidgetsStore
But what if I don't have the instances in a store? What if I have a bunch of Widget components who all have their own WidgetStore? I could use some kind of string passed in the constructor and add it to the
name
to make it unique.What if I don't have that kind of information or don't want my instanced stores to have that kind of information because of dependencies and decoupling?
We already give
this
tomakePersistable
. So we could already identify an instance in memory by checking with triple equality. Would it also be possible to do something like this for persisted stores? WheremakePersistable
has information about the actual instance that called it? If possible this could also make thename
property obsolete.Let me know your thoughts.