【发布时间】:2015-02-18 21:30:53
【问题描述】:
我一定错过了一些简单的东西,但无法弄清楚。我在 1 个 Web API 调用中检索了一堆查找表。
return EntityQuery.from('Lookups')
.noTracking(true)
.using(manager).execute()
.then(processLookups);
在 processLookups 中,我为返回的每个数组调用 getLocal。示例:状态表
datacontext.lookups = {
state: getLocal('States', orderBy.state, true),
....
}
function getLocal(resource, ordering, includeNullos) {
var query = EntityQuery.from(resource)
.orderBy(ordering)
.noTracking(true);
if (!includeNullos) {
query = query.where('id', '!=', 0);
}
return manager.executeQueryLocally(query);
}
数组是不可观察的,但数组对象中的每个属性都是可观察的函数。这只是我不需要的开销,因为这些不会改变。
如何防止对象属性被观察到?
谢谢
【问题讨论】:
标签: properties breeze observable