Replies: 1 comment
-
Am I running into the kind of trap described here? mobxjs/mobx-state-tree#1995 That is MST, and I'm just assuming the reference systems are similar in keystone and mst - if so, are references basically not really designed for the kind of server data modeling use case I'm trying to achieve here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to model the relationships that we have in our DB, using references. In the example below, a user has one tenant (and conversely a tenant has many users).
onAttachedToRootStore
approach in the user model below the best way to create and keep the tenant ref up to date, based on the tenant_id (which comes from the db)?getRefsResolvingTo
to get the tenant's users, however I don't see a way to get the user from the returned ref objects. Say for example I'd like to render a list of users for a given tenant (simplified) - I was hoping to be able to do something liketenant.users.map((u) => <div>{u.username}<div>)
.Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions