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

Transparent functional reactive programming


MobX is considered a Transparent functional reactive programming (TFRP) system. Yes, too many adjectives in that line! Let's break it down word by word.

 

It is Transparent...

Connecting the observables to the observers, it allows the observers to react to changes in observables. This is a basic expectation we have from MobX and the way we establish these connections feels very intuitive. There is no explicit wiring besides the use of decorators and dereferencing observables inside the observer. Because of the low overhead in wiring, MobX becomes very declarative, where you express your intent without worrying about the machinery. The automatic connections established between the observables and observers enables the reactive system to function autonomously. This makes MobX a transparent system as the work of connecting observables with observers is essentially lifted away. The usage of an observable inside a reaction is enough to wire the two.

It...