本文整理匯總了TypeScript中backburner.join函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript join函數的具體用法?TypeScript join怎麽用?TypeScript join使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了join函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
bb.run(() => {
assert.equal(depth(bb), 2);
bb.join(() => {
assert.equal(depth(bb), 2);
});
assert.equal(depth(bb), 2);
});
示例2: function
QUnit.test('outside of a run loop', function(assert) {
assert.expect(4);
let bb = new Backburner(['one']);
assert.equal(depth(bb), 0);
let result = bb.join(() => {
assert.equal(depth(bb), 1);
return 'result';
});
assert.equal(result, 'result');
assert.equal(depth(bb), 0);
});
示例3: invoked
QUnit.test('onError which does not rethrow is invoked (only once) when not joining an existing instance', function(assert) {
assert.expect(1);
function onError(error) {
assert.equal('test error', error.message);
}
let bb = new Backburner(['errors'], {
onError: onError
});
bb.join(() => {
throw new Error('test error');
});
});
示例4: Error
bb.run(() => {
bb.join(() => {
throw new Error('test error');
});
});