为什么 MobX 不太适合具有仅附加域模型的应用程序?

Why MobX is less suitable for applications that have an append only domain model?

MobX 的创建者 Michel Westrate 说:

MobX is suitable for building any app that needs to perform CRUD like operations on the state model. It is less suitable for applications that have an append only domain model.

如果我没理解错的话,"append only domain model" 可能指的是包含 feeds/lists 不断添加的数据的应用(例如 Facebook)。

他所说的 "append only domain model" 是什么意思,为什么 MobX 不适合它?

仅附加域模型永远不会改变状态。他们只是附加新状态。 MobX 的强大之处在于它能够 "watch" 声明并在发生突变时做出反应。但是因为你没有改变状态(只是追加)你失去了很多力量。

它仍然有用:如果你使用 MobX 来观看 "size" 或 "count" 或其他东西,那么当这些值随着状态被附加而改变时你会做出反应。这并不像同时观察 100 个状态对象并在其中任何一个发生变化时做出反应那么困难。