Skip to content

Using mobx-state-tree for MVVM pattern #2100

Discussion options

You must be logged in to vote

Hey @anishmiviewis - no apologies necessary. I'm happy to help.

I really like this approach. I did something similar in my app the other day and I had a really good experience with it. It's nice because you can test your MST store independently, and you can do pretty easy dependency injection for testing your React components as well. MobX-State-Tree also provides a nicer way to accomplish things that people often do by chaining useEffect and useState.

Here are a couple of things I'd be wary of, but your example doesn't seem to have these issues as written:

  1. MST doesn't like interacting between sibling stores. You can do it, but you have to use unprotect, which is a yellow flag. So if you…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@coolsoftwaretyler
Comment options

Answer selected by anishmiviewis
@anishmiviewis
Comment options

Comment options

You must be logged in to vote
3 replies
@coolsoftwaretyler
Comment options

@anishmiviewis
Comment options

@coolsoftwaretyler
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants