What is MobX? Explain like I am five 👋

  • By beginner, I expect at least to know what global variables, modular architecture and scope are.
  • Since this beginner doesn’t really know what is (thus also what state management is), I’d like to compare MobX to a fancy global variable(s).
  • Some really really novice developers might make it work with global variables and be happy.
  • Then, MobX will do so much more than just keep it accessible to other modules, it can execute some actions (calculations) to them, let your modules know as soon as some property changes, etc.
  • While MobX is just another state management tool, in my opinion it’s the best one to compare to ease of understanding global variables.

Answer (1 out of 2): Imagine mommy is making pancakes for you and your siblings. It’s a birthday party! She will keep bringing pancakes as long as you are hungry and having fun. She will also keep track of how many pancakes you ate and she knows what kind of pancakes you…

I don’t know many 5 year old beginner developers so your Q is a bit contradictory 🙂 So I’ll try to explain it like explaining to a beginner developer. By beginner, I expect at least to know what global variables, modular architecture and scope are. Since this beginner doesn’t really know what is (thus also what state management is), I’d like to compare MobX to a fancy global variable(s).

Every module in your app has some properties that often need to be visible (modifyable?) to other modules in your app. Some really really novice developers might make it work with global variables and be happy. It will take them some more studying to learn it’s not a good idea. Even then, some might try to pass variables/properties between modules, only to find out it becomes unmanageable mess prety soon. MobX to the help!

Instead of storing it to global variables, or passing it all around the placae, you can use MobxX to store (manage) it. Then, MobX will do so much more than just keep it accessible to other modules, it can execute some actions (calculations) to them, let your modules know as soon as some property changes, etc.

While MobX is just another state management tool, in my opinion it’s the best one to compare to ease of understanding global variables. Redux is a state management tool too, but I wouldn’t use this story…

What is MobX? Explain like I am five 👋