DEV Community

Discussion on: From Redux to MobX

 
mbarzeev profile image
Matti Bar-Zeev

interesting... I still think that having the state in a separated class, which can be tested quite easily as well, is a better approach.
It's nice, though, that MobX gives the flexibility to split the application state according to business contexts, but I believe it is more applicable to large scale application.
Great input, I will keep on digging into this :)

Thread Thread
 
romeerez profile image
Roman K

It's nice, though, that MobX gives the flexibility to split the application state according to business contexts, but I believe it is more applicable to large scale application.

Well, let's imagine simplified dev.to: article with "like" button and comments. And two MobX stores are serving this: Comments.store.ts and ArticleButtons.store.ts. It's hard to name this site "large scale application", but still splitting business contexts makes it cleaner. So, in my opinion, the way you write react should not be different depending of the size of the app. Writing state of every aspect of the app to the single store is just the same as writing all JSX in the single App file.