Skip to content

How to communicate across stores. #1993

Discussion options

You must be logged in to vote

Hey @KyryloSWAN - sorry it's been so long without a reply. Perhaps you were able to figure it out yourself, but I have some thoughts for you, or other folks with a similar question.

Assuming you are talking about sibling stores, such that there is a parent store, a child store A, and a child store B, you can think about it in two ways:

  1. One sibling, say child store A, uses getParent, or getParentOfType to get a reference to the parent store, and then asks the parent store to get a value from child store B.
  2. Your consuming application (such as a React component, or whatever else you are using alongside MST) requests the data from the parent store, and then provides it to the child store. So…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KyryloSWAN
Comment options

Answer selected by KyryloSWAN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants