官术网_书友最值得收藏!

Summary

The story of MobX revolves around observables. Actions mutate these observables. Derivations and Reactions observe and react to changes to these observables. Observables, actions, and reactions form the core triad.

We have seen several ways to shape your observables with objects, arrays, maps, and boxed observables. Actions are the recommended way to modify observables. They add to the vocabulary of operations and boost performance by minimizing change notifications. Reactions are the observers that react to changes in observables. They are the ones causing side-effects in the app.

Reactions come in three flavors, autorun(), reaction(), and when(), and distinguish themselves as being long-running or one-time. when(), the only one-time effector, comes in a simpler form, where it can return a promise, given a predicate function.

主站蜘蛛池模板: 灌南县| 定襄县| 茂名市| 紫金县| 忻城县| 高邑县| 康乐县| 沙坪坝区| 上虞市| 天峨县| 托克逊县| 衡东县| 桂林市| 庄河市| 石城县| 克拉玛依市| 兰溪市| 罗江县| 赤城县| 宝丰县| 朝阳县| 辉南县| 太湖县| 和平县| 安福县| 沽源县| 新晃| 潮州市| 开鲁县| 宁夏| 虹口区| 南京市| 富阳市| 威信县| 洪泽县| 千阳县| 洪泽县| 灌阳县| 曲麻莱县| 含山县| 柘城县|