我希望能够看到从mobx观察中添加的新玩家。
https://codesandbox.io/s/prod-dawn-z5jdv?file=/src/index.js
我只能看到很多元数据。元数据导航困难,层次低!
我只想看看观察者中添加的新Player对象!
发布于 2021-01-25 08:27:37
我刚想通了!执行此操作的方法是使用getSnapshot()
我不知道为什么/这背后的原因是什么,但我知道黑帮文档涵盖了getSnapshot!
observe(store.zone.players, (change) => {
const newPlayer = change.newValue.getSnapshot()
...do whatever else you need to do
});https://stackoverflow.com/questions/65853497
复制相似问题