本文整理汇总了TypeScript中ember-metal.flaggedInstrument函数的典型用法代码示例。如果您正苦于以下问题:TypeScript flaggedInstrument函数的具体用法?TypeScript flaggedInstrument怎么用?TypeScript flaggedInstrument使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了flaggedInstrument函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: run
run(() => {
let args = this.getActionArgs();
let payload = {
args,
target,
name: null,
};
if (typeof actionName[INVOKE] === 'function') {
flaggedInstrument('interaction.ember-action', payload, () => {
actionName[INVOKE].apply(actionName, args);
});
return;
}
if (typeof actionName === 'function') {
flaggedInstrument('interaction.ember-action', payload, () => {
actionName.apply(target, args);
});
return;
}
payload.name = actionName;
if (target.send) {
flaggedInstrument('interaction.ember-action', payload, () => {
target.send.apply(target, [actionName, ...args]);
});
} else {
assert(
`The action '${actionName}' did not exist on ${target}`,
typeof target[actionName] === 'function',
);
flaggedInstrument('interaction.ember-action', payload, () => {
target[actionName].apply(target, args);
});
}
});
示例2: get
if (targetAttribute && targetAttribute !== '_self') {
return false;
}
let qualifiedRouteName = get(this, 'qualifiedRouteName');
let models = get(this, 'models');
let queryParams = get(this, 'queryParams.values');
let shouldReplace = get(this, 'replace');
let payload = {
queryParams,
routeName: qualifiedRouteName,
};
// tslint:disable-next-line:max-line-length
flaggedInstrument('interaction.link-to', payload, this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace));
return false;
},
_generateTransition(payload: any, qualifiedRouteName: string, models: any[], queryParams: any[], shouldReplace: boolean) {
let routing = get(this, '_routing');
return () => {
payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace);
};
},
queryParams: null,
qualifiedRouteName: computed('targetRouteName', '_routing.currentState',
function computeLinkToComponentQualifiedRouteName(this: any) {
let params = get(this, 'params');
示例3: return
return (...args: any[]) => {
let payload = { target: self, args, label: '@glimmer/closure-action' };
return flaggedInstrument('interaction.ember-action', payload, () => {
return join(self, fn, ...processArgs(args));
});
};