本文整理匯總了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++);
});