问题
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