本文整理汇总了TypeScript中@orbit/utils.eq函数的典型用法代码示例。如果您正苦于以下问题:TypeScript eq函数的具体用法?TypeScript eq怎么用?TypeScript eq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eq函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: deepGet
Object.keys(replacement[grouping]).forEach(field => {
let value = replacement[grouping][field];
let currentValue = deepGet(current, [grouping, field]);
if (!eq(value, currentValue)) {
changed = true;
deepSet(result, [grouping, field], currentValue === undefined ? null : currentValue);
}
});
开发者ID:SmuliS,项目名称:orbit.js,代码行数:8,代码来源:inverse-transforms.ts
示例2:
Object.keys(updatedRecord.keys).forEach(key => {
let value = updatedRecord.keys[key];
if (record.keys === undefined || !eq(record.keys[key], value)) {
let op: ReplaceKeyOperation = {
op: 'replaceKey',
record: recordIdentity,
key,
value
};
diffs.push(op);
}
});
开发者ID:orbitjs,项目名称:orbit.js,代码行数:13,代码来源:operation.ts
示例3:
Object.keys(updatedRecord.attributes).forEach(attribute => {
let value = updatedRecord.attributes[attribute];
if (record.attributes === undefined || !eq(record.attributes[attribute], value)) {
let op: ReplaceAttributeOperation = {
op: 'replaceAttribute',
record: recordIdentity,
attribute,
value
}
diffs.push(op);
}
});
开发者ID:SmuliS,项目名称:orbit.js,代码行数:14,代码来源:operation.ts
示例4: addRecord
import { SyncRecordAccessor } from '../record-accessor';
export interface SyncInversePatchOperator {
(cache: SyncRecordAccessor, op: RecordOperation): RecordOperation;
}
export const SyncInversePatchOperators: Dict<SyncInversePatchOperator> = {
addRecord(
cache: SyncRecordAccessor,
op: AddRecordOperation
): RecordOperation {
const { type, id } = op.record;
const current = cache.getRecordSync(op.record);
if (current) {
if (eq(current, op.record)) {
return;
} else {
return {
op: 'updateRecord',
record: current
};
}
} else {
return {
op: 'removeRecord',
record: { type, id }
};
}
},
开发者ID:orbitjs,项目名称:orbit.js,代码行数:30,代码来源:sync-inverse-patch-operators.ts
注:本文中的@orbit/utils.eq函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论