上QQ阅读APP看书,第一时间看更新
Reactions
Reactions can really change the world for your app. They are the side-effect causing behaviors that react to the changes in observables. Reactions complete the core triad of MobX and act as the observers of the observables. Take a look at this diagram:
MobX gives you three different ways to express your reactions or side-effects. These are autorun(), reaction(), and when(). Let's see each of these in turn.