本文整理匯總了TypeScript中@phosphor/signaling.Signal.emit方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Signal.emit方法的具體用法?TypeScript Signal.emit怎麽用?TypeScript Signal.emit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@phosphor/signaling.Signal
的用法示例。
在下文中一共展示了Signal.emit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should find the given emission', async () => {
const owner = {};
const x = new Signal<{}, number>(owner);
const emission = testEmission(x, {
find: (a, b) => b === 1,
value: 'done'
});
x.emit(0);
expect(await isFulfilled(emission)).to.equal(false);
x.emit(1);
expect(await emission).to.equal('done');
});
示例2: it
it('should update whether it is shown if activeStateChanged fires', () => {
const item = new Widget();
let active = false;
const isActive = () => active;
const activeStateChanged = new Signal<any, void>({});
statusBar.registerStatusItem('item', {
item,
isActive,
activeStateChanged
});
expect(item.isHidden).to.be.true;
active = true;
activeStateChanged.emit(void 0);
expect(item.isHidden).to.be.false;
});