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

Subscriptions are out

One approach to handling data that changes is to observe it. This means using some mechanism to attach a listener callback function that's called whenever the data changes. For example, you could have data that models a user interface component, and when that data changes, you would render the component so that it reflects the changed data.

To set up subscriptions like this will require data that can change, which we don't want. Since we're working with immutable data that never changes, subscriptions are a dead end. This means that you have to rethink your approach for notifying components about the state of your data. The rule of thumb with immutable architectures is that only new data is passed around when things change.

主站蜘蛛池模板: 吉林省| 乐都县| 南涧| 元氏县| 梅州市| 澄城县| 洪洞县| 江口县| 武清区| 长葛市| 赤壁市| 盐源县| 安多县| 盐源县| 达州市| 聂拉木县| 万山特区| 工布江达县| 淮南市| 淮南市| 翁牛特旗| 德清县| 元朗区| 威信县| 玉山县| 漠河县| 出国| 清新县| 利津县| 屏东市| 蒙阴县| 高雄县| 张掖市| 长兴县| 开江县| 吉木萨尔县| 南充市| 开化县| 小金县| 班玛县| 昔阳县|