Skip to content
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

Understanding mobx-state-tree and when to use it. #420

Closed
Keats opened this issue Oct 4, 2017 · 5 comments
Closed

Understanding mobx-state-tree and when to use it. #420

Keats opened this issue Oct 4, 2017 · 5 comments

Comments

@Keats
Copy link

Keats commented Oct 4, 2017

The title is a callback to mobxjs/mobx#199 which had some pretty good discussion going on.

I think most people (including me) that are using mobx are using it with stores and a rootStore (like https://github.com/jeffijoe/libx#the-root-store).

Has anyone switched from something similar to mobx-state-tree? What are the concrete benefits?

@mattiamanzati
Copy link
Contributor

I think that 2 points in the FAQ cover some part of this question:

https://github.com/mobxjs/mobx-state-tree#when-not-to-use-mst
https://github.com/mobxjs/mobx-state-tree#how-does-mst-compare-to-redux

Feel free to ask anything :)

@Keats
Copy link
Author

Keats commented Oct 4, 2017

I've read those but the only point that I can see that differs from a classic store system is the JSON patches. All my stores are fully typed so the runtime type safety of MST sounds more like an overhead than a feature.

I guess I'm mostly trying to figure out/hear about the concrete advantages over plain stores and whether that's worth the 50kb.

@mattiamanzati
Copy link
Contributor

You also get action streams, which imply middlewares, which imply the ability of fine grained action revertability :)

@abelkbil
Copy link

abelkbil commented Feb 8, 2018

@Keats @mattiamanzati What is a sample use case of MST over Mobx, I got the point of reversibility via Snapshot.
Consider a live dashboard with some socket connections, MST will have overhead executions. And this is not the right choice for MST.

Type checking is another option available, Cant it complimented via Typescript Interfaces ?

Sorry I am not clear on the usecase.
Thank you all

@chj-damon
Copy link

@abelkbil Hi I want to know what is your way to construct multiple stores in your application. I followed the construction of the example 'mst-example-bookshop' but I don't know if it's the best practice or not. should I put all separated stores together or I can have multiple stores in my application?

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

No branches or pull requests

5 participants