Skip to Main Content
MobX Quick Start Guide
book

MobX Quick Start Guide

by Pavan Podila, Michel Weststrate
July 2018
Beginner content levelBeginner
236 pages
5h 34m
English
Packt Publishing
Content preview from MobX Quick Start Guide

The cycle of derivation

MobX uses a globalState to keep a reference to the currently executing derivation or reaction. Whenever a reaction is running, all observables that fire their reportObserved() will be tagged to this reaction. In fact, the relationship is bi-directional. An observable keeps track of all of its observers (reactions), while a reaction keeps track of all the observables it is currently observing. The currently executing reaction will be added as an observer for each of the observables. If the observer was already added, it will be ignored.

The observers all give back a disposer function when you set them up. We have already seen this with the return values of autorun(), reaction(), or when(), which are disposer functions. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Getting Started with Web Components

Getting Started with Web Components

Prateek Jadhwani

Publisher Resources

ISBN: 9781789344837Supplemental Content