如何刷新实体使用ember数据 [英] How to refresh entity using ember data

查看:101
本文介绍了如何刷新实体使用ember数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的演讲中,我收到了关于websockects的信息,对象被更改,并且ember数据应该重新加载它们。



如何强制emberdata更新已加载的记录?
如何强制emberdata从服务器得知某些记录已经被删除?

解决方案

我唯一的方法可以找到实现这样的东西是手动触发 App.store.loadMany(data)与json(如果你有),或执行 App.store.findQuery(App.Model,{}),这将使您的缓存无效。



我几天开了一个问题以前在ember上询问一下:



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



似乎他们正在处理这种情况 - ember / data是还是很年轻!


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?

解决方案

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!

这篇关于如何刷新实体使用ember数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆