Book Image

MobX Quick Start Guide

By : Pavan Podila, Michel Weststrate
Book Image

MobX Quick Start Guide

By: Pavan Podila, Michel Weststrate

Overview of this book

MobX is a simple and highly scalable state management library in JavaScript. Its abstractions can help you manage state in small to extremely large applications. However, if you are just starting out, it is essential to have a guide that can help you take the first steps. This book aims to be that guide that will equip you with the skills needed to use MobX and effectively handle the state management aspects of your application. You will first learn about observables, actions, and reactions: the core concepts of MobX. To see how MobX really shines and simplifies state management, you'll work through some real-world use cases. Building on these core concepts and use cases, you will learn about advanced MobX, its APIs, and libraries that extend MobX. By the end of this book, you will not only have a solid conceptual understanding of MobX, but also practical experience. You will gain the confidence to tackle many of the common state management problems in your own projects.
Table of Contents (17 chapters)
Title Page
Dedication
Packt Upsell
Foreword
Contributors
Preface
Index

Summary


In this chapter, we covered the practical aspects of adopting MobX with packages such as mobx-utils and mobx-state-tree. These packages codify the community wisdom around using MobX for a variety of scenarios.

mobx-utils gives you a set of utilities for tackling asynchronous tasks, dealing with expensive updates, creating view models for transactional-editing, and much more.

mobx-state-tree is a comprehensive package that is meant to simplify application development with MobX. It takes a prescriptive approach to structuring and organizing the observable state in MobX. With such a declarative approach, MST is able to get a deeper understanding of the state-tree and offer a variety of features, such as runtime type-checking, snapshots, JSON-patches, middlewares, and so on. Overall, it helps in developing a crisp mental model of your MobX application and puts the typed-domain-model at the forefront.

In the next chapter, we will culminate the journey on MobX with a peek into its inner workings...