MobX Quick Start Guide
上QQ阅读APP看书,第一时间看更新

Foreword

I started my journey on Reactive Programming several years ago, when Reactive Programming on frontend wasn't "a thing".

At the beginning, there weren't many references or books available to apply this paradigm on frontend applications; therefore, I had to spent a lot of time extracting the key concepts of Reactive Programming from books on Java or Clojure, university white papers, and blog posts.

In the past two years though, slowly but steadily, the community started developing many frameworks and libraries that shape the frontend Reactive ecosystem we know nowadays.

Reactive Programming is getting a lot of traction. Companies such as Netflix, Microsoft, IBM, and many others are using this paradigm, leveraging the strong decoupling provided out of the box by this paradigm and the unidirectional data flow used in many Reactive state management systems.

From the developers, community, we had a strong push on sharing great reactive implementations, such as Rx.JS, Cycle.js, VueX, SAM patterns, Angular with NGRX, and many others.

There is one though that is standing out from the crowd, created by a bunch of smart developers; it is called MobX.

MobX is the perfect companion for starting your journey on Reactive Programming. It is easy to learn, applies reactivity with a few lines of code, and it could be used without deeply knowing this paradigm. It can also be used for digging into the reactive programming roots.

MobX ecosystem provides the flexibility of structuring small projects, such as a Proof of Concept (PoC), or large projects managed by several teams, thanks to MobX State Tree (MST).

I had the opportunity to work on both MobX and MST: I created some simple PoCs for validating my theories, and also architected a micro-frontend system with tens of developers working with MST.

I saw how well thought out and designed this system was and how fast it was, picking it up from scratch, by other developers.

As you will discover in these pages, MobX will provide you with the flexibility smartness behind architectural and design decisions that you were looking for. It is the perfect companion for any experienced person or a newcomer to the reactive programming movement.

Enjoy your journey into MobX and MST, I'm sure you won't regret it!

Luca Mezzalira

Author, Speaker, Chief Architect at DAZN, Google Developer Expert and manager of the London JavaScript community