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


TypeScript Signal.emit方法代碼示例

本文整理匯總了TypeScript中core/signaling.Signal.emit方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Signal.emit方法的具體用法?TypeScript Signal.emit怎麽用?TypeScript Signal.emit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在core/signaling.Signal的用法示例。


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

示例1: redo

 redo() {
   if (this.can_redo()) {
     this.state.index += 1;
     this._do_state_change(this.state.index);
     return this.state_changed.emit(undefined);
   }
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:7,代碼來源:plot_canvas.ts

示例2: push_state

  push_state(type, info) {
    const prev_info = (this.state.history[this.state.index] != null ? this.state.history[this.state.index].info : undefined) || {};
    info = extend({}, this._initial_state_info, prev_info, info);

    this.state.history.slice(0, this.state.index + 1);
    this.state.history.push({type, info});
    this.state.index = this.state.history.length - 1;

    return this.state_changed.emit(undefined);
  }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:10,代碼來源:plot_canvas.ts

示例3: it

    it("should support `{dis}connect()` method", () => {
      const signal = new Signal(Object.create(null), "some")

      let signaled: number = 0
      const fn = (val: number) => signaled = val

      expect(signal.connect(fn)).to.be.equal(true)
      expect(signal.connect(fn)).to.be.equal(false)

      expect(signaled).to.be.equal(0)

      signal.emit(1)
      expect(signaled).to.be.equal(1)
      signal.emit(2)
      expect(signaled).to.be.equal(2)

      expect(signal.disconnect(fn)).to.be.equal(true)
      expect(signal.disconnect(fn)).to.be.equal(false)

      signal.emit(3)
      expect(signaled).to.be.equal(2)
    })
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:22,代碼來源:signaling.ts

示例4:

document.addEventListener("click", () => clear_menus.emit(undefined))
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:1,代碼來源:common.ts

示例5: clear_state

 clear_state() {
   this.state = {history: [], index: -1};
   return this.state_changed.emit(undefined);
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:4,代碼來源:plot_canvas.ts

示例6: throttle

this.throttled_paint = throttle((() => this.force_paint.emit(undefined)), 15); // TODO (bev) configurable
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:1,代碼來源:plot_canvas.ts

示例7: update

 update({xs, ys}) {
   this.setv({xs, ys, screen: true}, {silent: true});
   return this.data_update.emit();
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:4,代碼來源:poly_annotation.ts

示例8:

 window._bokeh_gmaps_callback = () => gmaps_ready.emit(undefined);
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:1,代碼來源:gmap_plot_canvas.ts

示例9: update

 update({left, right, top, bottom}) {
   this.setv({left, right, top, bottom, screen: true}, {silent: true});
   this.data_update.emit();
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:4,代碼來源:box_annotation.ts


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