當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript signaling.Signal類代碼示例

本文整理匯總了TypeScript中@phosphor/signaling.Signal的典型用法代碼示例。如果您正苦於以下問題:TypeScript Signal類的具體用法?TypeScript Signal怎麽用?TypeScript Signal使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Signal類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it('should resolve to the given value', async () => {
   const owner = {};
   const x = new Signal<{}, number>(owner);
   const emission = testEmission(x, {
     value: 'done'
   });
   x.emit(0);
   expect(await emission).to.equal('done');
 });
開發者ID:AlbertHilb,項目名稱:jupyterlab,代碼行數:9,代碼來源:utils.spec.ts

示例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;
 });
開發者ID:afshin,項目名稱:jupyterlab,代碼行數:15,代碼來源:statusbar.spec.ts

示例3: expect

 session.messageReceived.connect((sender, msg) => {
   expect(sender).to.be(session);
   if (msg.type === 'stdout') {
     Signal.disconnectReceiver(object);
     done();
   }
 }, object);
開發者ID:dalejung,項目名稱:jupyterlab,代碼行數:7,代碼來源:terminal.spec.ts

示例4: catch

 signal.connect((sender: T, args: U) => {
   if (!options.find || options.find(sender, args)) {
     try {
       Signal.disconnectReceiver(object);
       if (options.test) {
         options.test(sender, args);
       }
     } catch (e) {
       done.reject(e);
     }
     done.resolve(options.value || undefined);
   }
 }, object);
開發者ID:afshin,項目名稱:jupyterlab,代碼行數:13,代碼來源:index.ts

示例5: expect

 (s, type) => {
   expect(defaultSession.path).to.equal(newPath);
   expect(type).to.equal('path');
   called = true;
   Signal.disconnectReceiver(object);
 },
開發者ID:willingc,項目名稱:jupyterlab,代碼行數:6,代碼來源:session.spec.ts

示例6:

 (s, args) => {
   called = args;
   Signal.disconnectReceiver(object);
 },
開發者ID:willingc,項目名稱:jupyterlab,代碼行數:4,代碼來源:session.spec.ts

示例7: expect

 defaultSession.propertyChanged.connect((s, type) => {
   expect(defaultSession.path).to.be(newPath);
   expect(type).to.be('path');
   called = true;
   Signal.disconnectReceiver(object);
 }, object);
開發者ID:dalejung,項目名稱:jupyterlab,代碼行數:6,代碼來源:session.spec.ts


注:本文中的@phosphor/signaling.Signal類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。