How to refresh entity using ember data

让人想犯罪 __ 提交于 2019-12-19 20:37:02

问题


In my aplication I recived with websockects info about with objects are changed and ember data should reload them.

How can I force emberdata to update already loaded record? How can I force emberdata to get know from server that some records are already delted?


回答1:


The only way I could find to achieve something like this is to trigger manually App.store.loadMany(data) with the json (if you have it), or performing a App.store.findQuery(App.Model, {}), which will invalidate your cache.

I opened an issue a few days ago on ember to ask about this:

https://github.com/emberjs/data/issues/245

It seems like they're working on this case scenarios - ember/data is still quite young!



来源:https://stackoverflow.com/questions/10563384/how-to-refresh-entity-using-ember-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!