本文整理汇总了TypeScript中@eg/core/event.service.EventService.parse方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.EventService.parse方法的具体用法?TypeScript service.EventService.parse怎么用?TypeScript service.EventService.parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@eg/core/event.service.EventService
的用法示例。
在下文中一共展示了service.EventService.parse方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
resp => {
let result = resp.result;
const holdResult: HoldRequestResult = {success: true};
// API can return an ID, an array of events, or a hash
// of info.
if (Number(result) > 0) {
// On success, the API returns the hold ID.
holdResult.holdId = result;
console.debug(`Hold successfully placed ${result}`);
} else {
holdResult.success = false;
console.info('Hold request failed: ', result);
if (Array.isArray(result)) { result = result[0]; }
if (this.evt.parse(result)) {
holdResult.evt = this.evt.parse(result);
} else {
holdResult.evt = this.evt.parse(result.last_event);
}
}
request.result = holdResult;
return request;
}
示例2:
).subscribe(bktId => {
const evt = this.evt.parse(bktId);
if (evt) {
this.toast.danger(evt.desc);
} else {
this.addToBucket(bktId);
}
});
示例3:
).toPromise().then(resp => {
const evt = this.evt.parse(resp);
if (evt) {
this.toast.danger(evt.toString());
} else {
this.close();
}
});
示例4:
).toPromise().then(async(result) => {
if (Number(result) === 1) {
this.numSucceeded++;
this.toast.success(await this.successMsg.current());
} else {
this.numFailed++;
console.error('Retarget Failed', this.evt.parse(result));
this.toast.warning(await this.errorMsg.current());
}
});
示例5: async
async(result) => {
if (Number(result) === 1) {
this.numSucceeded++;
this.toast.success(await this.successMsg.current());
} else {
this.numFailed++;
console.error(this.evt.parse(result));
this.toast.warning(await this.errorMsg.current());
}
this.cancelNext(ids);
}
示例6:
).toPromise().then(async(result) => {
if (Number(result) === 1) {
this.numSucceeded++;
this.toast.success(await this.successMsg.current());
} else {
this.numFailed++;
console.error('Mark missing failed ', this.evt.parse(result));
this.toast.warning(await this.errorMsg.current());
}
return this.markOneItemMissing(ids);
});
示例7: reject
).subscribe(queue => {
const e = this.evt.parse(queue);
if (e) {
reject(e);
} else {
// createQueue is always called after queues have
// been fetched and cached.
this.allQueues[qType].push(queue);
resolve(queue.id());
}
});