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

Cleaning up the store

There are improvements we can make to on the store. There is no need to write all the code we do currently. In fact, there are libraries out there that do a better job of handling certain functionality.

Before we apply all those changes we have in mind, let's recap what our store can do and what features still need to be in place after the cleanup work.

Let's remind ourselves, what our store is capable of so far:

  • Handles state changes: It handles the state changes; the store is able to change the state regardless of whether it is creating, updating, listing, or removing state.
  • Subscribable: It lets you subscribe to it; it's important for the store to have a subscription functionality so a view, for example, can listen to the store's state when it changes. A suitable reaction by the view is, for example, rerendering based on new data.
  • Can communicate a state change: It can send an event that its state has been changed; this goes together with being able to subscribe to the store, but this is the very act of actually notifying a listener that a state has changed.
主站蜘蛛池模板: 木里| 定南县| 泗洪县| 大埔县| 三河市| 芮城县| 张掖市| 蓬安县| 绥滨县| 靖远县| 盐津县| 玉环县| 大方县| 青浦区| 会东县| 方山县| 清远市| 奉贤区| 资溪县| 普宁市| 隆尧县| 崇仁县| 夹江县| 改则县| 玛沁县| 阿图什市| 嘉善县| 开原市| 六安市| 赞皇县| 顺义区| 宿松县| 胶州市| 阳原县| 闻喜县| 六安市| 崇明县| 太仓市| 青河县| 拉萨市| 高雄县|