本文整理汇总了TypeScript中ember-metal.watchKey函数的典型用法代码示例。如果您正苦于以下问题:TypeScript watchKey函数的具体用法?TypeScript watchKey怎么用?TypeScript watchKey使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了watchKey函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: compute
compute() {
let { _parentReference, _parentObjectTag, _propertyKey } = this;
let parentValue = _parentReference.value();
_parentObjectTag.inner.update(tagForProperty(parentValue, _propertyKey));
let parentValueType = typeof parentValue;
if (parentValueType === 'string' && _propertyKey === 'length') {
return parentValue.length;
}
if (parentValueType === 'object' && parentValue !== null || parentValueType === 'function') {
if (MANDATORY_SETTER) {
watchKey(parentValue, _propertyKey);
}
if (EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER) {
this.tag.didCompute(parentValue);
}
return get(parentValue, _propertyKey);
} else {
return undefined;
}
}
示例2: compute
compute() {
let { _parentReference, _parentObjectTag, _propertyKey } = this;
let parentValue = _parentReference.value();
_parentObjectTag.inner.update(tagForProperty(parentValue, _propertyKey));
let parentValueType = typeof parentValue;
if (parentValueType === 'string' && _propertyKey === 'length') {
return parentValue.length;
}
if ((parentValueType === 'object' && parentValue !== null) || parentValueType === 'function') {
if (DEBUG) {
watchKey(parentValue, _propertyKey);
}
if (DEBUG) {
(this.tag.inner as TwoWayFlushDetectionTag).didCompute(parentValue);
}
return get(parentValue, _propertyKey);
} else {
return undefined;
}
}
示例3: constructor
constructor(parentValue: any, propertyKey: string) {
super();
this._parentValue = parentValue;
this._propertyKey = propertyKey;
if (EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER) {
this.tag = new TwoWayFlushDetectionTag(tagForProperty(parentValue, propertyKey), propertyKey, this);
} else {
this.tag = tagForProperty(parentValue, propertyKey);
}
if (MANDATORY_SETTER) {
watchKey(parentValue, propertyKey);
}
}
示例4: constructor
constructor(parentValue: any, propertyKey: string) {
super();
this._parentValue = parentValue;
this._propertyKey = propertyKey;
if (DEBUG) {
this.tag = TwoWayFlushDetectionTag.create(
tagForProperty(parentValue, propertyKey),
propertyKey,
this
);
} else {
this.tag = tagForProperty(parentValue, propertyKey);
}
if (DEBUG) {
watchKey(parentValue, propertyKey);
}
}