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

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.

主站蜘蛛池模板: 大荔县| 岳池县| 阿瓦提县| 莎车县| 尚志市| 竹山县| 凯里市| 习水县| 通渭县| 文山县| 深圳市| 贺州市| 晋城| 杭锦后旗| 松原市| 巴楚县| 马龙县| 天长市| 博野县| 英吉沙县| 平顶山市| 伊春市| 营山县| 凌源市| 盐源县| 内黄县| 榕江县| 新邵县| 桦川县| 通城县| 门源| 宁阳县| 呈贡县| 故城县| 东乡县| 定安县| 凤翔县| 扎赉特旗| 淮滨县| 武定县| 长阳|