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

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.

主站蜘蛛池模板: 丰都县| 沙田区| 庄河市| 浪卡子县| 麻栗坡县| 新野县| 巩留县| 衡东县| 郎溪县| 福贡县| 东阳市| 恭城| 长春市| 凤冈县| 共和县| 基隆市| 游戏| 龙井市| 南雄市| 高陵县| 阳曲县| 嘉义市| 长沙县| 德化县| 元朗区| 定安县| 德保县| 呼伦贝尔市| 商城县| 扶风县| 南通市| 三亚市| 扎囊县| 永登县| 达拉特旗| 三原县| 易门县| 焦作市| 应用必备| 南康市| 剑阁县|