您如何在Falcor中使整个范围无效? [英] How do you invalidate a whole range in Falcor?

查看:79
本文介绍了您如何在Falcor中使整个范围无效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个简单的类别和文章系统,并且有这样的路径可以获取特定类别中所有文章的列表.

Suppose I have a simple system of categories and articles, and there's a path like this to get a list of all the articles in a specific category.

categoriesById[{integers:ids}].articles[{ranges:rows}]

现在,该路线采用硬编码,以便按照最新的顺序对文章进行排序,因此,当我添加新文章时,我需要(假定)使类别中的所有文章失效,因为我希望将文章0设为新文章.

Now, that route is hard-coded to sort the articles by newest first, so when I add a new article, I need to (I assume) invalidate all the articles within a category because I want article 0 to be the new article.

是否有一种简便的方法可以使类别中的整个文章范围无效,或者我是否需要使categoriesById下的每个article都显式无效,或者是否可以将项目拼接到列表中?在JSONGraph中?

Is there a short-hand way to invalidate the entire range of articles within a category, or do I need to invalidate every article under categoriesById explicitly, or, is there a way to splice an item into a list in the JSONGraph?

推荐答案

您可以使用

请注意,您可能希望您的call tu返回有关新创建的文章或更新的文章数的更多信息.在这里,它只返回必须从客户端缓存中删除整个articles数组的事实,什么也不返回.要返回更多信息,可以将路径/值对添加到返回的数组中.

Note that you may want your call tu return more information about the newly created article or the updated number of articles. Here it returns nothing but the fact that the entire articles array must be erased from the client's cache. To return more information, you can add path/value pairs to the returned array.

这篇关于您如何在Falcor中使整个范围无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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