How to get data of different model in MST? #2503
-
This is the parent store .model("PropertyStore") I have a list in "PropertyListModel" that I want to get inside "PropertyDetailsModel" This is the propertyDetailsModel.ts export const PropertyDetailsModel = types
})) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
hey @mrshahzeb7 , you can do this by using the So, for example if your root store looked something like this:
You could then call on a property from the list store in detail store with:
|
Beta Was this translation helpful? Give feedback.
hey @mrshahzeb7 , you can do this by using the
getRootStore
helper here: https://github.com/infinitered/ignite/blob/master/boilerplate/app/models/RootStore.tsSo, for example if your root store looked something like this:
You could then call on a property from the list store in detail store with:
getRootStore(_self).propertyListStore.myProp