-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Representing array of models in the state tree #1
Comments
This should give a rough idea: The Note that you don't have to resolve via strings, you can also introduce a computed property yourself, and write something like:
Resolving a list of identifiers is still on the todo list, but will be part of the first version :) Sorry for not having docs yet, they will be added, but ATM this is quite alpha :) |
I'm kind of lost :) I understand it's alpha, no worries. With the risk of sounding silly, what's the benefit of using Or more specifically isn't there a away to do the same thing without Moreover As you mentioned - using getters and setters is enough to do resolving logic. It is also as custom as a person like. Why not stop there? Wouldn't it be better if |
So, I looked into this project after zalmoxisus/mobx-remotedev#1 (comment)
Before I can comment there, I'm wondering how should the developer represent array of models with
mobx-state-tree
?Currently I have something like
store.featuredProducts
which is an observable array. How does the resolution (resolve(this, '/users', this._author)
) works? Why do I needthis
and identifier? Does it work only for resolving single objects? Can it batch resolve? Anyway, can you give an example how would that happen, so I visualize this best?Another negative for me is the '/users' identifier. Using identifiers feels a step back for me. I would prefer if there is a instance of a ModelManager then can retrieve it by class/object like:
The text was updated successfully, but these errors were encountered: