本文整理汇总了TypeScript中vs/base/common/winjs.base.TPromise.timeout方法的典型用法代码示例。如果您正苦于以下问题:TypeScript base.TPromise.timeout方法的具体用法?TypeScript base.TPromise.timeout怎么用?TypeScript base.TPromise.timeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/base/common/winjs.base.TPromise
的用法示例。
在下文中一共展示了base.TPromise.timeout方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
let sub = participant.getOnWillSaveTextDocumentEvent(nullExtensionDescription)(function (event) {
event.waitUntil(TPromise.timeout(10));
event.waitUntil(TPromise.timeout(10));
event.waitUntil(TPromise.timeout(10));
});
示例2: assert
var factoryFactory = (n: number) => () => {
activePromises++;
assert(activePromises < 6);
return TPromise.timeout(0).then(() => { activePromises--; return n; });
};
示例3:
var factory = () => {
return TPromise.timeout(0).then(() => {
return ++count;
});
};
示例4: Promise
var factory = () => new Promise((c, e, p) => {
TPromise.timeout(0).done(() => {
p(order++);
c(true);
});
});
示例5:
let sub = participant.onWillSaveTextDocumentEvent(function (event) {
event.waitUntil(TPromise.timeout(15));
});
示例6: Cache
const cache = new Cache(() => {
counter1++;
return TPromise.timeout(1).then(() => counter2++);
});